PHP dynamically generated thumbnails and output the method of display, PHP dynamically generated thumbnail image
The examples in this article describe how PHP dynamically generates thumbnails and outputs the display. Share to everyone for your reference. Specific as follows:
Call Method:
This code can dynamically generate thumbnail display for large images, images generated in memory, not hard disk to generate real files
The thumbs.php file is as follows:
<?php$filename= $_get[' filename '; $width = $_get[' width '); $height = $_get[' height ']; $path = "http://localhost/images/"; Finish in "/"//Content Typeheader (' content-type:image/jpeg ');//Get new Dimensionslist ($width _orig, $height _orig) = g Etimagesize ($path. $filename), if ($width && ($width _orig < $height _orig)) { $width = ($height/$height _ ORIG) * $width _orig;} else { $height = ($width/$width _orig) * $height _orig;} Resample$image_p = Imagecreatetruecolor ($width, $height); $image = Imagecreatefromjpeg ($path. $filename); Imagecopyresampled ($image _p, $image, 0,0,0,0, $width, $height, $width _orig, $height _orig);//Outputimagejpeg ($image _p , null, +);//Imagedestroyimagedestroy ($image _p);? >
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/987255.html www.bkjia.com true http://www.bkjia.com/PHPjc/987255.html techarticle PHP dynamically generated thumbnails and output the method of display, PHP dynamic generation of thumbnails in this article, we describe the dynamic generation of PHP thumbnails and output display methods. Share to everyone for your reference. ...