dongyu5104 2009-08-27 11:26
浏览 99

使用php函数imagecreatefromjpeg对具有Adobe1998颜色配置文件的图像的问题

I have used the following code to create jpeg image using existing images. These images have used embedded color profile, Adobe1998 color profile.

header("Content-type: image/jpeg");
$src = imagecreatefromjpeg($upfile);
$dst = imagecreatetruecolor($tn_width, $tn_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width, $height);
imagejpeg($dst,NULL,100);
imagedestroy($src);
imagedestroy($dst);

The problem here is that when the image is displayed embedded color profile is not seen. Can anyone help me? What may be the problem ?

Thanks in advance

  • 写回答

2条回答 默认 最新

  • duansan9435 2009-08-27 12:42
    关注

    imagecratefromjpeg() makes use us the GD2-Lib, which seems not to support color profiles. You should consider using imagemagick to resize your image like this:

    convert mypicture.jpg -resize 50%  resized.jpg
    

    The color profile should be still in the image.

    评论

报告相同问题?