Some say that BLOBS are unefficient or even stupid to use, but the truth is that dinamic content works much better while having the capability of reading information "attached" in some way to the image.
imagecreatefromstring gives you the posibility to create great thumbnails, see the examples given in the comments above.
If you must create an image in the middle of a sea of html, it's always possible using the output buffering options (see function "ob_start();"), so you don´t have to deal with annoying "headers already sent..." problems. Some still say that it is not possible, well, they have to read a little.
If you still cannot get rid of "ÿØÿà", try using your script for creating thumbnails in a separate file, just call it from your main page, here´s an example:
MY MAIN PAGE CALLS THE THUMBNAILING SCRIPT IN ORDER TO OUTPUT AN IMAGE TO THE BROWSER: <?php echo "<img src=\"view.php?se={$row_Recordset1['id']}\";></img>"; ?>
MY THUMBNAILING SCRIPT WORKS IN A SEPARATE FILE "view.php" wich resizes and gives output:
READY!!!!! You have a fully functional thumbnails gallery. not given 03-Aug-2003 08:14 A note to the previous question (if you still don't know it :))...
GIF's are 256 colors (or 8 bit), and the resample function needs true color I guess... that's why it works with JPG's and not with GIF's.
Next thing... you take a string, write it to file, open the file (imagecreatefromgif), and delete the file again.
if you do imagecreatefromstring($string) you can skip the temporary file part. shiehj at yahoo dot com 12-Apr-2003 03:44 Here is the code I did to create a thumbnail image from the database blob field. The trick is to use "imagecreatefromstring()" to create an image file.
Jack Shieh
<?php require("dbconfig.inc");
$id = $_GET['id'];
if($id) {
$link = @mysql_connect($host, $user, $password) or die("Could not connect: " . mysql_error()); @mysql_select_db($dbname, $link);
$query = "select filetype, image from pictures where id = $id"; $result = @mysql_query($query);
// determine image type and send it to the client if ($type == "image/pjpeg") { imagejpeg($img); } else if ($type == "image/x-png") { imagepng($img); } else if ($type == "image/gif") { imagegif($img); } imagedestroy($img); mysql_close($link); }; ?> adrian_schmidt at yahoo dot com 05-Mar-2003 10:04 I'm trying to get the imagecreatefromstring to work with GIFs. Of course, it won't. I've read the tips but can't get them to work either. The following is what I tried, based on above tips:
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.