Hi,

Sunday, December 7, 2003, 6:38:13 PM, you wrote:
G> I'm using a MySQL database to store images as BLOBs. I know how to 
G> handle all the MySQL stuff, it's easy, and really makes keeping track 
G> of files nice an clean. No permissions, no risk of getting things out 
G> of sync, finding stuff is as easy as SQL.

G> My question is about handling stuff once you pull it out of the 
G> database. When I store images in the database, I currently stash the 
G> format and the resolution in the database, which works but is a bit 
G> messy. I can't find any easy way to run getimagesize on the contents of 
G> a variable, not a file. I could write the image to a file if I needed 
G> to, but that can be slow and rather inelegant, I'd rather store the 
G> values in the DB. Any ideas on how I could use getimagesize or similar 
G> function to determine the format and resolution of the image in a 
G> variable?

G> I have had a similar problem with ftp uploading. There was no way to 
G> upload the contents of a variable, so I had to write everything to the 
G> disk, kind of annoying when I have 1,000 files. The script wasn't a 
G> very heavily used script nor could the public execute it, but it bugged 
G> me to no end. I think there are some other functions that also only 
G> operate on files and I've fought with them too.

G> Is there any kind of generic solution for this? Some kind of wrapper I 
G> could use to make a variable act like a reference to a file but 
G> actually be in memory only?

G> If this seems totally pointless, please tell me. But it seems like 
G> there should be a way for almost any function that runs off a file to 
G> run off the contents of a variable, it's just binary data.

G> Thanks,
G>      Galen


Do the get sizes while it is still as a file after upload then save the size
info with the file in the db or use unpack to get the size from the raw data, it
is usually in the header somewhere.

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to