PHP uses the GD library to generate high-quality thumbnails. Generally, the thumbnails generated by PHP are not ideal. Today, I tried PHP and the GD library to generate thumbnails. Although not 100% perfect. However, it should also be able to meet the requirements of thumbnails. The following is the PHP source code (ResizeImage. php ).
The code is as follows:
$ FILENAME = "image. thumb ";
// Generate the image width
$ RESIZEWIDTH = 400;
// Generate the image height
$ RESIZEHEIGHT = 400;
The following is the test code (demo. php)
The code is as follows:
Include ('resizeimage. php ');
If (! Empty ($ _ POST )){
Echo ($ FILENAME. ". jpg? Cache = ". rand (999999 ));
}
?>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.