Now, the company has a project that allows users to upload images and view images, which is similar to Baidu cloud. Then I have a requirement to view the thumbnail first, click the source image to view the source image. I can see that Weibo has this function, and I want to know how they do this function, is uploaded directly... now, the company has a project that allows users to upload images and view images, which is similar to Baidu cloud. Then I have a requirement to view the thumbnail first, click the source image to view the source image. I can see that Weibo has this function, and I want to know how they do this function, how many versions of images are directly compressed during upload, or are images temporarily compressed only when the front-end is loaded?
I want a static server to automatically compress images when outputting images, as qiniu mentioned in the following article does not have the same functionality as qiniu, you only need to simply compress the image according to the proportion of the image, but the compression is better. I have used some compression to compress the image. the sharpness of the pressed image is particularly high and the image is quite real.
I read this article about Web performance optimization: Image optimization, and I think it is helpful. The Google PageSpeed he mentioned can be deployed on the Apache server and will be automatically compressed when obtaining images, it seems suitable. But I searched and found that this is only a tool for detecting server performance, not for compressing images?
Reply content:
Now, the company has a project that allows users to upload images and view images, which is similar to Baidu cloud. Then I have a requirement to view the thumbnail first, click the source image to view the source image. I can see that Weibo has this function, and I want to know how they do this function, how many versions of images are directly compressed during upload, or are images temporarily compressed only when the front-end is loaded?
I want a static server to automatically compress images when outputting images, as qiniu mentioned in the following article does not have the same functionality as qiniu, you only need to simply compress the image according to the proportion of the image, but the compression is better. I have used some compression to compress the image. the sharpness of the pressed image is particularly high and the image is quite real.
I read this article about Web performance optimization: Image optimization, and I think it is helpful. The Google PageSpeed he mentioned can be deployed on the Apache server and will be automatically compressed when obtaining images, it seems suitable. But I searched and found that this is only a tool for detecting server performance, not for compressing images?
A large number of images are directly compressed into several versions when being uploaded (by compressing queue tasks to prevent excessive resource occupation)
There are a lot of compression Implementation Solutions, a bunch of github
Do not use PHP for static files. Use nginx for static files.
For image cropping, nginx has plug-ins that can be used as a c-language plug-in. The speed is definitely better than PHP.
You can use php to dynamically generate thumbnails only once the access is generated and then use static files. This nginx can be configured.
As for image quality, the php ecosystem mainly relies on the expansion of gd imagick. The latter generally says that the quality is relatively good. The sharpness problem should be caused by unreasonable parameters in the call library. We suggest you calm down and try again.
Is it possible to compress the file directly during upload, store a thumbnail, and call the thumbnail directly during display? When you click the mouse, you can directly release the address of the large image to solve the problem. You do not need to store the database locally according to certain rules. It can be assembled when obtained.
I 'd like to know you about QQ: 810978593