473,382 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

imagecreatefromjpeg drops IPTC data

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
Jul 18 '08 #1
0 1147

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Markus Bulmer | last post by:
Hi, I'm trying to do a photo album with php. The admins should be able to write comments, descriptions etc. into the jpeg files via a web form. I tried to implement this with the (still...
0
by: Jonah Bossewitch | last post by:
Hi, I am using PIL's IptcImagePlugin to extract the IPTC tags from an image file. I was able to successfully retrieve the tags from the image (thanks!), but the results are keyed off of cryptic...
2
by: Lionel | last post by:
Hi, I need to read the IPTC *keywords* tag from a jpeg file. I can read all the EXIF tags with this little part of code: string MyFile = "c:\afile.jpeg" Image MyImage =...
1
by: Lionel | last post by:
Hi, I need to read the IPTC *keywords* tag from a jpeg file. I can read all the EXIF tags with this little part of code: string MyFile = "c:\afile.jpeg" Image MyImage =...
0
by: mv | last post by:
Hi, Is there a way in vb.net to use the Server.Transfer function to load a classic asp page (asp 3.0)? I get the error "Error executing child request". Another question: I am also looking for a...
1
by: blindlemonsam | last post by:
Hi, I'm using the Python Imaging Library (PIL v1.1.6) to batch resize images. Problem is, it erases the IPTC and EXIF data for the resized file. I want the data to stay. Help??
1
by: SPE - Stani's Python Editor | last post by:
Phatch is a simple to use cross-platform GUI Photo Batch Processor Phatch handles all popular image formats and can duplicate (sub)folder hierarchies. It can batch resize, rotate, apply...
1
by: Jumping Arne | last post by:
I'm completely new to PIL and I'm trying to read IPTC info, I understand that it's possible but I can't find out how (and for once Google doesn't seem to be able to help). Does anyone have an...
1
by: Scott SA | last post by:
On 4/30/08, Jumping Arne (arnlen@mac.com) wrote: Some basic PIL info: <http://www.pythonware.com/library/pil/handbook/index.htm> <http://effbot.org/imagingbook/has a tutorial and more info ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.