Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

[BUGFIX] Changed default MediaPicker image file format to JPEG on iOS

Open leonluc-dev opened this issue 3 years ago • 3 comments

Description of Change

In Xamarin.Essentials on iOS, whenever the MediaPicker returns an image not represented by a file (mainly camera captures) it defaults to a PNG format in the result.

This is a very inefficient file format for camera images and inconsistent with Xamarin.Essential image capture behaviour on Android, UWP and Tizen, which all return JPEG formatted images by default.

This PR changes the result type for camera captures to JPEG for efficiency and to be consistent with the other platforms supported in Xamarin.Essentials.

Bugs Fixed

  • Fixes issue #1697

API Changes

Added:

None

Changed:

None

Behavioral Changes

On iOS the FileResult returned by CapturePhotoAsync is now a JPEG formatted image.

PR Checklist

  • [X] Has tests (if omitted, state reason in description)
  • [X] Has samples (if omitted, state reason in description)
  • [X] Rebased on top of main at time of PR
  • [X] Changes adhere to coding standard
  • [ ] Updated documentation (see walkthrough)

leonluc-dev avatar Apr 08 '21 11:04 leonluc-dev

bump

  • we are running into issues with too large files when capturing photo on iOS devices

mikkelAtVisma avatar Jun 30 '21 08:06 mikkelAtVisma

another bump - quite a big issue for us :/

MitchBomcanhao avatar Aug 03 '21 13:08 MitchBomcanhao

Not sure what the intended behavior for iOS is, but by using a PNG the file size is actually 4x larger than expected.

hminaya avatar May 03 '22 14:05 hminaya

As this is a breaking change at this point, we won't be implementing this for Xamarin.Essentials anymore, thanks for all the time and effort here!

jfversluis avatar Feb 07 '23 10:02 jfversluis