Anyways, I am trying to accept photos with transparent backgrounds on iOS using Camera.getPhoto but have been unable to configure it to do that correctly.
Did I miss something or is this a current limitation? (If so, can you suggest a work-a-round plz?)
When I use the term “work around”, I mean “something that I can do in my code to change how somebody else’s code behaves”.
I also think I can provide more useful assistance the better I understand what somebody’s ultimate goal is, as opposed to what they consider their proximate goal.
Your proximate goal is that you want PNG. I want to know why.
Because if the answer is something like “because PNG is lossless, JPEG is lossy, and I don’t want lossy”, I would urge rethinking the situation. Cellphone cameras these days provide extremely high resolution images, and the compression system used by JPEG is specifically designed to provide optimal performance for typical photos. It’s faster, it’s easier to deploy hardware acceleration, and it makes for smaller files that reduce stress on many chokepoints in your app. Additionally, once something has been compressed as JPEG (which, as I understand it, is true of every photo taken with Android or iOS), you’re not going to get any higher image quality than what is initially provided.
The only other reason that comes to mind is “I have an image manipulation library that works with PNG but not JPEG” (which would surprise me). If that is indeed the case, then you could transcode in your app.
As for “if it’s gonna be available”, I don’t think that’s an Ionic question, but rather a Google/Apple question, because the underlying limitation comes from the OS.
So I’m probably understanding something incorrectly. My goal is this:
I’m getting files into my app using Camera.getPhoto both with using the camera and just for using the gallery for convenient access to local user files. But when the user selects these files using Camera.getPhoto and they turn into .jpeg, I lose their transparency, which was unexpected for me and I’m searching for solutions. (what was previously transparent background is now a black background)
From your answer I understand that this is OS limitation ?