Php: how to compress the image size first, let's talk about our website. after the website is written in the background, the editors upload images as needed. many images are saved in the png format by default by QQ. The code for uploading images is written by a colleague who uses ueditor and does not control the upload size. my colleague resigned last week and handed over his work to me. In the morning, O & M told me that our website occupies too much bandwidth. The reason is that the picture is too large.
Enter the subject:
For uploaded images, how to compress the images, or when a request is made, the images returned by http are smaller. The size of the png images uploaded by colleagues Is KB, and the boss requires that the images be smaller than 50 kB. What I can do now is to control the image size during upload. It is impossible to change the uploaded files one by one. it is too time-consuming.
Reply to discussion (solution)
Now it's just a few megabytes on your phone... Which has 50 k...
According to the information disclosed by lz, the company where lz is located may be a broken company:
1: The employee unexpectedly chooses to resign at the end of this year. the normal departure time is in the first few months of the next year, so there will be a year-end bonus, however, lz's colleagues leave in this time period, and are very dissatisfied with their work. All companies that allow employees to leave their jobs during this period are certainly not very good.
2: The boss of the company where lz is located has invited a 50 k ticket. isn't that a nonsense? Do I need to pay more for bandwidth? It can be seen that this boss is definitely a growth ratio. how can a boss with a growth ratio have a good company.
Therefore, I hope that I can leave the company after cooking and find a better destination.
Well, you can download the website to your local computer and then use the software that compresses images in batches.
Download the image lossless compression master
PS has batch processing
You have written a batch processing program. for details, refer.
Search for image files (jpg, gif, and png) in directories and subdirectories, and compress images larger than a certain value.
Http://blog.csdn.net/fdipzone/article/details/39651709