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.

    评论

报告相同问题?

悬赏问题

  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗