Click here to get back home

imagecreatefromjpeg drops IPTC data

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
imagecreatefromjpeg drops IPTC data Math 07-18-2008
Get Chitika Premium
Posted by Math on July 18, 2008, 8:27 am
Please log in for more thread options
Hi,
i'm using a small function found somewhere to watermark a JPG before
outputting to a website.
Since watermark change according to some other info, I can't create
watermark JPG before.

This is the function:

function watermark($sourcefile, $watermarkfile) {
//Get the resource ids of the pictures
$watermarkfile_id = imagecreatefrompng($watermarkfile);

imageAlphaBlending($watermarkfile_id, false);
imageSaveAlpha($watermarkfile_id, true);

$sourcefile_id = imagecreatefromjpeg($sourcefile);

//Get the sizes of both pix
$sourcefile_width=imageSX($sourcefile_id);
$sourcefile_height=imageSY($sourcefile_id);
$watermarkfile_width=imageSX($watermarkfile_id);
$watermarkfile_height=imageSY($watermarkfile_id);

$dest_x = 5;
$dest_y = 5;

imagecopy($sourcefile_id, $watermarkfile_id, $dest_x, $dest_y, 0,
0,$watermarkfile_width, $watermarkfile_height);

//Create a jpeg out of the modified picture
header("Content-type: image/jpg");
imagejpeg ($sourcefile_id,null,100);

imagedestroy($sourcefile_id);
imagedestroy($watermarkfile_id);
}

That would be perfect, if only imagecreatefromjpeg wouldn't remove the IPTC
tags in jpg!!
Does someone have a solution for this issue?

-fabio



Similar ThreadsPosted
connection drops while script running February 15, 2008, 5:43 am
ImageCreateFromjpeg - php function September 16, 2004, 12:42 pm
imagecreatefromjpeg problem June 21, 2005, 5:21 pm
imagecreatefromjpeg problem July 13, 2005, 6:12 pm
PHP dies when you use imagecreatefromjpeg() April 10, 2006, 10:40 am
Issues with ImageCreateFromJPEG June 15, 2006, 7:01 am
imagecreatefromjpeg failing November 29, 2006, 6:04 pm
imageCreateFromJPEG() Crash/Freeze/??? August 25, 2004, 7:55 pm
imagecreatefromjpeg, calling a .php file April 16, 2006, 2:01 am
imagecreatefromjpeg failing with lack of memory August 20, 2004, 11:43 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap