views:

151

answers:

2

Hi,

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

A: 

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.

schneck
Thanks schneck I'll try it.
Hi schneck, I installed imagemagick and before completing the installation message is displayed as (You have now installed ImageMagick. To test the installation select Command Prompt from the Windows Start menu. Within the window type:convert logo: logo.miffimdisplay logo.miffand the ImageMagick logo should be displayed in a window.)But when i run the above in command prompt displays like this "the system can not execute the specified program"Can you suggest me what may be the problem. Thanks
Seems like your windows cannot find the imagemagick executables. While I do not own windows, I think you should search for the file "convert.exe", and then, in the command line, change into that directory by typing "cd <the path here>". Then you should be able to run the convert-program.
schneck
A: 

Color profiles are pieces of information embeded in the image specific to the display media that was used originally (basically matches the color-profile for you monitor), so when opening the same image on another media, the colors will be adjusted after opening it to match more closely what you saw initially on your monitor.

Try using convert as schneck sugested, and if that dosen't work, you may also try GIMP from the command line. I've never personally used it from the cmd line, but it does support color profiles, and i know it has some options for batch transformations.

Quamis