Description
in src/Essentials/src/MediaPicker/MediaPicker.ios.cs#L611 you can see the following:
bool ShouldUsePngFormat()
{
// Use PNG if:
// 1. High quality (>=90) and no resizing needed (preserves original format)
// 2. Original file was PNG
// 3. Image might have transparency (PNG supports alpha channel)
bool highQualityNoResize = compressionQuality >= 90 && !maximumWidth.HasValue && !maximumHeight.HasValue;
bool originalWasPng = !string.IsNullOrEmpty(originalFileName) &&
(originalFileName.EndsWith(".png", StringComparison.OrdinalIgnoreCase) ||
originalFileName.EndsWith(".PNG", StringComparison.OrdinalIgnoreCase));
// For very high quality or when original was PNG, preserve PNG format
return (compressionQuality >= 95 && !maximumWidth.HasValue && !maximumHeight.HasValue) || originalWasPng;
}
- the check for
highQualityNoResize is then discarded and computed again
- the
compressionQuality value is initially checked at 90%, then replaced with 95% in the second computation . which one is it? the comment matches the 90% one.
- there are two different checks for
originalFileName.EndsWith, with different casings of the same string, with an OrdinalIgnoreCase string comparer, so they're both effectively the same thing.
Lastly, this magical compression figure over which the PNG file format is used is rather unexpected. I didn't expect to have to inspect the maui source code to figure this out.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
10.0.11
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
Description
in
src/Essentials/src/MediaPicker/MediaPicker.ios.cs#L611you can see the following:highQualityNoResizeis then discarded and computed againcompressionQualityvalue is initially checked at90%, then replaced with95%in the second computation . which one is it? the comment matches the90%one.originalFileName.EndsWith, with different casings of the same string, with an OrdinalIgnoreCase string comparer, so they're both effectively the same thing.Lastly, this magical compression figure over which the PNG file format is used is rather unexpected. I didn't expect to have to inspect the maui source code to figure this out.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
10.0.11
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output