简体   繁体   中英

On iOS, how do I resize a very large image on the client side in a web app?

Using JavaScript and HTML5, you can take a Image class and draw it on a canvas , then redraw it pixel by pixel smaller to another canvas . But if the image is too large, it will fail. By large, I mean 3500x2500 or 3.5mb for the iPhone 4s through iPhone 6+

Unfortunately, the camera on the iPhone is taking images much larger than what appears to be resizable on the client. I cannot resize on the server, due to data constraints. Do I have any options?

I did find the Megapixel library that seems to correct this issue, though the documentation isn't clear that is it's purpose.

https://github.com/stomita/ios-imagefile-megapixel

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM