> Subject: Dynamic Thumbnail From Database Solution! > Date: Mon, 23 Jul 2001 17:37:56 -0700 > From: "Jason Bell" <[EMAIL PROTECTED]> > To: "PHP Users" <[EMAIL PROTECTED]> > CC: <[EMAIL PROTECTED]> .... > > Using getpic.php in conjuction with the <IMG> tag can display the fullsize picture. > > Now, to the fun part! Dynamicly creating a thumbnail from the fullsize binary within >your database. To create the thumbnail, I have a script called mkthumb.php: > > <?php > $src = >imagecreatefromjpeg("http://www.barkingrat.com/photo/getpic.php?id=$id"); > $twidth = imagesx($src)/3; > $theight = imagesy($src)/3; > $img = imagecreate($twidth,$theight); > >imagecopyresized($img,$src,0,0,0,0,$twidth,$theight,imagesx($src),imagesy($src)); > imagejpeg($img); > imagedestroy($img); > ?> > > You use mkthump.php in the same exact way that you use getpic.php. Now, obviously, >mkthumb.php needs to be modified to handle filetypes other than jpeg. That should be >a simple task, I just haven't done it yet.... should be as simple as checking the >file type (I insert the type into a column when I store the original image) > > this works..... if anyone can think of a better way to do anything I have done, >feel free to add your 2 cents.... I'm certainly open to it. :) > > Jason Bell Hi Jason! Your solution is very interesting, but I think it is necessary GD library to built dynamic thumbnails. My PHP provider has no GD library installed, so I am searching for some other miraculous solution. Here another idea: it is possible to store thubnails into JPG header files, this is allowed by JPG specifications, but I don't know PHP functions to retrieve thubnails from into JPG streams. The <img .... heigh=value width=value > html code won't prevent downloading all bytes from image. I think I am lost. Any idea?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]