-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App InfoEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infogood first issueGood for newcomersGood for newcomersplatform/ioss/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working
Milestone
Description
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
highQualityNoResizeis then discarded and computed again - the
compressionQualityvalue is initially checked at90%, then replaced with95%in the second computation . which one is it? the comment matches the90%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
Metadata
Metadata
Assignees
Labels
area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App InfoEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infogood first issueGood for newcomersGood for newcomersplatform/ioss/triagedIssue has been reviewedIssue has been reviewedt/bugSomething isn't workingSomething isn't working