javascript - How to compress images to a specified volume (not a specified size) on the JS side
大家讲道理
大家讲道理 2017-05-19 10:19:18
0
1
537

Compress the image to within the specified size. For example, 500KB
is not the specified size. Can 200X300
be achieved? The ones I can find online are all in designated sizes.

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
phpcn_u1582

Can be implemented through Canvas, there is an open source project on Github: Portal

Pure front-end implementation, does not rely on the backend. However, the use of Canvas and File API has higher requirements on the browser (IE6/7/8 does not need to consider orz).

Demo address: Portal (tip: jquery uses google cdn and needs to cross the wall)

Screenshot:

Compression effect:

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!