ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️

Home Page:https://capacitorjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature]: native camera resolution, rotation and max size settings

Aarbel opened this issue · comments

Description

Natively include settings to

  • directly have non rotated pictures without javascript manipulation
  • don't upload pictures of 200Mo on recent phones, making app crash
  • being able to set a max size of pictures taken with capacitor camera

Platforms

  • iOS
  • Android
  • Web

Request or proposed solution

When some users use he capacitor camera, the browser sometimes crashes due to very high resolution (due to modern phones cameras).
We are now handling the pictures compression / resize with javascript, but browser hardly manipulate pictures of 200Mo in a mobile webview, causing app crashes.

Alternatives

Javascript alternatives are not good, because mobile web browsers most of the time don't have enough RAM to handle this kind of pictures.

Additional Information

No response

closing as duplicate of ionic-team/capacitor-plugins#2080

Would be better to copy all the information in that issue since the information there is empty and could be closed because of that.

BTW, the camera plugin has correctOrientation option to have non rotated pictures that works on Android and iOS.
Also has width and height options for the pixel size, I guess you mean file size, would be good if you add that information to the ticket.

Thanks @jcesarmobile, modifications added on the ticket ✅

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.