When uploading images in php, what common classes can be used for proportional compression?

Source: Internet
Author: User
When uploading images in php, what common classes can be used for proportional compression? A small system that uploads images.

However, the uploader has no idea about the image size. he does not know that there is a problem with the webpage display of the 4000*3800 resolution image taken by the camera, the uploaded images must be displayed on the webpage, and the number of uploaded images is large.

So I would like to ask if there are any classes that can do the following steps...

1. receive jpg, png, and bmp files (the uploader may be ignorant of the possibility of using all types)

2. check that if the image width is greater than 1000 or the height is greater than 1000, the image will be compressed to a width or height of not greater than PX in an equal ratio.
(Skip this step if both width and height are less than 1000)

3. compress and optimize the size of a piece


Can I introduce this category? Or is there an image Upload plug-in for this type? The paid plug-in is recommended.

Thank you.


Reply to discussion (solution)

The class, http://blog.csdn.net/fdipzone/article/details/9316385 that I wrote before

The class, http://blog.csdn.net/fdipzone/article/details/9316385 that I wrote before


It is a little different from what I want to use.
But it is very useful for reference. if you have time to write your own image class, you must first thank you.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.