Hi guys!
I'm still working with this gallery thing if you read my posts a few days ago!
Look, I've got some thumbnails generated with gd from pictures sent over a form.
To store these files on the database I would use something like:
$imgData =addslashes (file_get_contents($_FILES['pic']['tmp_name']));
$query = "INSERT INTO myFile (file_name, _file, file_size, file_type, upload_date, width, height)
VALUES('{$_FILES['pic']['name']}', '$imgData', '{$_FILES['pic']['size']}', '{$_FILES['pic']['type']}', NOW(), '{$image_size[0]}', '{$image_size[1]}')";
right?
Well, to get the thumnail I use a funciton that works perfectly:
$newFile = resize_then_crop( $_FILES['pic']['tmp_name'],THUMB_W,THUMB_H,"255","255","255");
(If I change the header's content type, and echo the $newFile variable, my thumbnail will be displayed perfectly.)
Here comes the problem, I need to read the data from this new image. I need to get the data that I was getting on the first block of code of this post with addslashes and file_get_contents, but how?
I can not use [FONT=Courier New]file_get_contents[/FONT] because I get an error, I guess because it's not a physical file, also, trying to insert $newFile as if it was $imgData will not work, no image data will be inserted. I just need this pictures's data, because the other values are somekind of presets for my applicaiton
How can I read the data from this thumbnail generated by gd?
Any help will be appreciated!