Storing img into db does not work with imagecreatefromjpeg?

From: Date: Sat, 25 May 2002 12:57:42 +0000
Subject: Storing img into db does not work with imagecreatefromjpeg?
Groups: php.general 
Request: Send a blank email to php-general+get-99230@lists.php.net to get a copy of this message
Hi there, I would like to save images into a blob column. Works good if I use the tmp file php has created after submitting the form. But if I do some gd stuff like changing some colors with inside the image and then save this immage, it does not work. I used to save the image to a file with: imagejpeg($picture, $name); // this works and now I try to save it to the db with: $picture = ImageCreateTrueColor($maxX, $dstY); //... some funky stuff like using the uuploaded file and mixing it with a water mark $data = addslashes($picture); $stmt =" INSERT INTO test.picture_test (file_name, file_type, picture) VALUES ('$name', '$picture_location_type', '$data') "; Like I said if I replace the $picture with the variable of the tmp field it works fine. I tryed also to do an imagejpeg before saving to the db, but it did not change anything. Thank you so much for any hint, Andy

« previous php.general (#99230) next »