Re: Re: How do I read Exif data without a file?

From: Date: Sun, 26 Feb 2006 09:59:00 +0000
Subject: Re: Re: How do I read Exif data without a file?
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-231097@lists.php.net to get a copy of this message
Niels wrote:
I think you misunderstand the situation. [snip]
I've got a database of images (image data) and their exif data, I'm not uploading any files. I want to make new entries in that DB, new images that are thumbnails of the present images. I can do that without creating files, but I can't get exif data of these thumbnails, because there are no files. The exif data for the thumbnails isn't the same as for the full images. In PHP its not easy to keep EXIF data of JPEG or TIF files as it is if you use PHP functions to recreate the temporary files in some dir.
Basically when you use tempnam() it creates a temporary file. To get the thumbnails you must rewrite the resized file to some place (if you want real thumbnail image). You cannot preserve exif data with any of PHP functions available. You probably have to use some specially developed code to write exif data. I tried this class http://www.zonageek.com/software/php/jpeg/ I tried to use it but either it could not write all the exif data or I was not calling required functions properly.. It requires pear.. Other you can try is http://pel.sourceforge.net/ But both of these will require you to write a resized image and then write exif data (common for both, original and resized) retrieved from the original image to the new thumbnail you generated with additional image specific exif info. Best is to maintain thumbnails.. with exif data written in it too. Regards, -- Sameer N. Ingole Blog: http://weblogic.noroot.org/ --- Better to light one candle than to curse the darkness.

« previous php.general (#231097) next »