hi friends
a question:
i want to fetch an image(type:blob) from sql database and then copy it to another image with imagecopy().i use this :
....$row=mysql_fetch_query($query);
$content=$row['image'];
imagecopy($image,$content,0,0,0,0,$w,$h);
imagejpeg($image);
(header is sent and $image made by imagecreate())
but the error says:imagecopy():supplied argument is not a valid image resource
why here is this error
is it nessasary that i first stor the image in a binary temprary file and then send it to the function???
regards
error with imagecopy!!!
Moderators: onion2k, General Moderators
Re: error with imagecopy!!!
When you fetch the data from the database it's just a blob of binary data ... PHP doesn't know it's an image. You need to tell it that it is. Use...
You should then be able to use $image where you tried to use $content before.
Code: Select all
$image = imagecreatefromstring($content);Re: error with imagecopy!!!
thank u very much onion2k it works
