About 0x00
This article mainly analyzes PHP's use of the GD Library's imagecreatefrompng () function to reconstruct a PNG image may result in a local file inclusion vulnerability.
When the system exists the point that the file contains, can
Deployment environmentSystem: CentOS6.8 x86_64apache:2.4.23mysql:5.7.14php:7.0.10apr:1.5.2apr-util:1.5.4boost:1.59.0cmake:3.6.1pcre:8.39Package PreparationHere CentOS6.8 system (no graphics environment) installation process slightly, using the PC
Event Origin: Discuz Background to open the Chinese code hint said does not support FreeType, but FreeType seems to need GD2 call to take effect.So the installation of GD2, installation of GD2 by the time the installation of Jpeg,png,zlibThe
PHP implements the method of scaling PNG images (supports transparent backgrounds), PNG zoom
The example in this paper describes how PHP implements scaling of PNG images. Share to everyone for your reference. The implementation method is as follows:
Let your PHP support GIF, PNG, and JPEG at the same time
The RedHat6.2 is compiled and installed in PHP manual, and it is found that only GIF images can be processed and JPEG images cannot be processed. Later know that PHP processing images, using
Copy CodeThe code is as follows:
/*PHP generates a text PNG image, which can be called using the following methods:Http://www.yourdomian.com/text_png.php3?msg=helloworld+class&rot=15&size=48&f/ARIAL. TTF*/Header ("Content-type:image/png");Class
Note: This feature relies on the GD2 graphics library
recently to use PHP to generate thumbnails, find a bit online, found this article: PHP Generate thumbnail image
After a trial, we found that there were several problems:
1. PNG images generated
When using mysql, you sometimes need to query records with unique fields. Although mysql provides the keyword distinct to filter out redundant duplicate records, only one record is retained, but it is often used to return the number of records that
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.