Image Conversion

wxdqz

New Member
I am storing a family photo album in MySQL BLOB fields. I want to create a thumbnail when a new image is uploaded. I've tried to do this using ImageMagick with the following code. The conversion doesn't work and I end up with a full size image in the ThumbNail field of my table. Any suggestions?

//store original to a variable $data1=addslashes(fread(fopen(stripslashes($form_data),"r"),filesize($form_data)));
//create an ImageMagick command to convert the data
$command = "mogrify -geometry 100x100 ".$form_data;

array($out);
exec($command,$out);
//try to figure out if any errors are returned
for($i=0;$i<sizeof($out);$i++)
print "<br>$out[$i]";
//ImageMagick should replace the original file with the resized version
$data2=addslashes(fread(fopen(stripslashes($form_data),"r"),filesize($form_data)));
 
Back
Top