Upload and zoom processing of image files using PHP and ImageMagick
PHP processing file Upload is very simple, but if you want to upload the image zoom processing, although it can be done with GD, but
To carry out the more cumbersome processing. ImageMagick is an image processing package, which is common in Linux software packages. It contains the Xu
Multi-processing Image tool, it can be transformed into image file format can also be a variety of image processing, where we will use its
Image scaling feature. This is implemented through the tool convert in its package so that you can invoke the
Convert-geometry width x Gao yuan file scaled file
Please create a images directory under the current directory and make the Web executable user writable, which is used to store uploaded pictures and
The scaled picture.
Below is a simple small example, including image upload and processing, tested under redhat6.0+php3.0.12.
If you combine the getimagesize function, we can also control the size of the scale. The database can be indexed or stored in the image file.
ImageMagick function is very powerful, not only can the picture file scaling, but also to flip, format conversion and so on.
Readers can refer to ImageMagick's Help file themselves.
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.