Hi all,
I store images in my DB as BLOB. When I want to place them in an html
table, I want to determine the width of the image in order to asign the
correct width to the column inside table.
For JPEGs this is working fine, this is my code:
$image = @imagecreatefro mstring($r["foto"]);
return @imagesx($image );
where $r["foto"] is the field selected from the db which contains the image.
For GIFs however, its getting really on my nerves !!
I know imagecreatefrom string is not supported in gd2 and I tried several
thinks. None of them worked ! :
-
$temp = tmpfile();
list($width, $height, $type, $attr) = getimagesize($t emp);
echo $attr;
gives me :Warning: getimagesize: Unable to open 'Resource id #6' for reading
-
$handle = fopen("/tmp/tmp.dat", "w+");
fwrite($handle, $r["foto"]);
list($width, $height, $type, $attr) = getimagesize($h andle);
echo $attr;
gives me : Warning: getimagesize: Unable to open 'Resource id #6' for
reading
-
Doing this with imagecreatefrom gif($temp); wont work either !
Can somebody help me out please? by telling me what I'm doing wrong or what
I should do.
Regards,
Kristof
I store images in my DB as BLOB. When I want to place them in an html
table, I want to determine the width of the image in order to asign the
correct width to the column inside table.
For JPEGs this is working fine, this is my code:
$image = @imagecreatefro mstring($r["foto"]);
return @imagesx($image );
where $r["foto"] is the field selected from the db which contains the image.
For GIFs however, its getting really on my nerves !!
I know imagecreatefrom string is not supported in gd2 and I tried several
thinks. None of them worked ! :
-
$temp = tmpfile();
list($width, $height, $type, $attr) = getimagesize($t emp);
echo $attr;
gives me :Warning: getimagesize: Unable to open 'Resource id #6' for reading
-
$handle = fopen("/tmp/tmp.dat", "w+");
fwrite($handle, $r["foto"]);
list($width, $height, $type, $attr) = getimagesize($h andle);
echo $attr;
gives me : Warning: getimagesize: Unable to open 'Resource id #6' for
reading
-
Doing this with imagecreatefrom gif($temp); wont work either !
Can somebody help me out please? by telling me what I'm doing wrong or what
I should do.
Regards,
Kristof
Comment