Re: Re: How do I read Exif data without a file?
| From: | Niels | Date: | Sat, 25 Feb 2006 22:49:39 +0000 |
| Subject: | Re: Re: How do I read Exif data without a file? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231071@lists.php.net to get a copy of this message | ||
On Saturday 25 February 2006 23:42, chris smith wrote:
>> > I have some images in a database -- I mean, the actual data. There are
>> > no files.
>> >
>> > I want to read Exif data for these images, but the read_exif_data()
>> > function wants a file. I suppose I could write the images to temp
>> > files, but that's a bit wasteful. And where would I write them? Is
>> > there a folder I can count on being allowed to write to?
>> >
>> Answering myself: I solved this with tempnam(). I'm not completely sure
>> about the portability, and of course it's a waste to write a file at all.
>> And it could pose a security problem as well. Ho hum.
>
> You only need to do it once - then store it back in the database. That
> info isn't going to change.
>
> When you store the image in the database you can get the info and store it
> then.
No, I can't. I've got some images, with exif information in the DB. I'm now
generating thumbnails for them, and also storing those in the DB. No files
at all, and therefore I can't read exif data for the thumbnails.
As I said I've solved the problem by writing a temporary file and reading
exif from that. Not pretty or efficient, but it works.
//Niels