2009-08-12 12 views
2

オープンソース画像操作ツールImageMagickを使用して、さまざまなファイルのサムネイルを取ります。私たちは、一部のブラウザ(Internet Explorer 8とChrome)でJPEGファイルを表示できないことがわかってしまうまで、すべての作業が非常にスムーズに実行されていると考えました。ImageMagickサムネイルが一部のブラウザで表示されない

ImageMagick変換の出力はウェブセーフなJPEGではないとしか考えられません。これはなぜですか、それはまったく修正できますか?

ちなみに、私たちは、コマンドラインツールconvertを使用していて、私たちは、これらのパラメータを使用している:

convert -thumbnail 150x fileToThumb outputPath 

編集:ここでは

Image: 50afd2b1-e42c-4e90-9244-9c5a00c1933d.jpg 
    Format: JPEG (Joint Photographic Experts Group JFIF format) 
    Class: DirectClass 
    Geometry: 150x212+0+0 
    Resolution: 72x72 
    Print size: 2.08333x2.94444 
    Units: PixelsPerInch 
    Type: ColorSeparation 
    Endianess: Undefined 
    Colorspace: CMYK 
    Depth: 8-bit 
    Channel depth: 
    cyan: 8-bit 
    magenta: 8-bit 
    yellow: 8-bit 
    black: 8-bit 
    Channel statistics: 
    cyan: 
     min: 0 (0) 
     max: 255 (1) 
     mean: 28.492 (0.111734) 
     standard deviation: 61.879 (0.242663) 
     kurtosis: 5.32422 
     skewness: 2.47138 
    magenta: 
     min: 0 (0) 
     max: 255 (1) 
     mean: 43.5579 (0.170815) 
     standard deviation: 72.7733 (0.285386) 
     kurtosis: 1.31682 
     skewness: 1.57362 
    yellow: 
     min: 0 (0) 
     max: 255 (1) 
     mean: 53.0706 (0.20812) 
     standard deviation: 85.3198 (0.334587) 
     kurtosis: -0.0841614 
     skewness: 1.2581 
    black: 
     min: 0 (0) 
     max: 52 (0.203922) 
     mean: 0.149434 (0.000586016) 
     standard deviation: 1.78161 (0.00698672) 
     kurtosis: 364.996 
     skewness: 17.91 
    Image statistics: 
    Overall: 
     min: 0 (0) 
     max: 255 (1) 
     mean: 25.054 (0.098251) 
     standard deviation: 61.3102 (0.240432) 
     kurtosis: 5.28177 
     skewness: 2.5304 
    Total ink density: 300% 
    Rendering intent: Undefined 
    Interlace: None 
    Background color: white 
    Border color: cmyk(223,223,223,0) 
    Matte color: grey74 
    Transparent color: black 
    Page geometry: 150x212+0+0 
    Dispose: Undefined 
    Iterations: 0 
    Compression: JPEG 
    Quality: 92 
    Orientation: Undefined 
    Properties: 
    create-date: 2009-08-17T11:38:16+01:00 
    jpeg:colorspace: 4 
    jpeg:sampling-factor: 1x1,1x1,1x1,1x1 
    modify-date: 2009-08-17T11:37:48+01:00 
    signature: f5e85add196c10f1d73f416482e779245595a644877696fffb2637b5b97f6b9c 
    Artifacts: 
    verbose: true 
    Tainted: False 
    Filesize: 20.5kb 
    Number pixels: 31.1kb 
    Version: ImageMagick 6.5.3-10 2009-06-19 Q16 OpenMP http://www.imagemagick.org 

は(出力を識別もこのJPEG画像を表示していることに気づいているがMacではベタ黒色の画像):

[この画像はどこですか]

+0

生成されているサムネイル画像のBitDepthとは何ですか? – Wade

答えて

5

JPEGの色空間がRGBであることを確認してください。ブラウザは他の色空間と似ていません。それを確認するには

、あなたは別の色空間を持っていれば、コマンドに

identify -verbose path/to/jpeg.jpg 

を識別出力は

Format: JPEG (Joint Photographic Experts Group JFIF format) 
    Class: DirectClass 
    Geometry: 467x330+0+0 
    Type: TrueColor 
    Endianess: Undefined 
    Colorspace: RGB  <----you are looking for this 
    Depth: 8-bit 
    ... 

(それは約50行の長一般的です)このようにオフを開始すべきであるImageMagickのを使用(CMYKなど)を使用する場合は、変換コマンドラインで-colorspace RGBを使用して、RGBカラースペースを強制的に使用することができます。

それでも問題が解決しない場合は、identifyコマンドの出力全体を質問に貼り付け、診断に役立てることができます。

+0

Cheers Paulは、変換結果を見て、ファイルがRBGで、深さが8ビットであることを示しています(例によると)。 – Owen

+0

ok、あなたの質問にIDの出力を貼り付けることをお勧めします。 –

+0

識別情報、歓声で編集を追加しました。 – Owen

0

gb1981の答えはOKで変換しますが、私は追加する必要があります:私のためには、それは確実に動作します。-type truecolor

convert cmyk.jpg -colorspace rgb -type truecolor rgb.jpg