dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

Add tests for Resize and DownSize for every platform in Maui.Graphics for both landscape- and portrait-oriented images. #14445

Open janseris opened 1 year ago

janseris commented 1 year ago

Description

Please add tests for Resize and DownSize for every platform (most importantly Android and then Windows) in Maui.Graphics for both rotation landscape and portrait JPG and PNG photos. These are the most common image processing scenarios. At the moment I have no clue if it's working and I am suspicious because it hadn't been properly working when .NET MAUI Graphics was a separate repo in spring 2022.

https://github.com/dotnet/Microsoft.Maui.Graphics/issues/437 https://github.com/dotnet/Microsoft.Maui.Graphics/issues/436 https://github.com/dotnet/Microsoft.Maui.Graphics/pull/453 (fix already released) https://github.com/dotnet/Microsoft.Maui.Graphics/issues/422 https://github.com/dotnet/Microsoft.Maui.Graphics/issues/247 (might be fixed, but no info about that) https://github.com/dotnet/Microsoft.Maui.Graphics/issues/242 (might be fixed, but no info about that)

Hint 1: the easiest scenario to start with is testing PNG because it's losless and thus platform implementations should result in the same pixel data in the end.

Hint 2: checking the file result to compare with an image processed by a different engine might be tricky because e.g. the JPG and PNG files contain metadata which could but also could not be preserved and also modified (but that's not the point of this basic scenario). Example: http://oozcitak.github.io/exiflibrary/articles/PNGMetadata.html, http://oozcitak.github.io/exiflibrary/articles/JPEGMetadata.html. However handling Exif metadata correctly is a whole different subject.

Also it seems like different JPG exporters might have different pixel data output with the same quality setting (but I am not sure about this statement because I have not studied that in depth).

Another trick with JPG: If source image (e.g. PNG) contains color RGB(5, 28, 44), the output JPG will never contain that color: https://stackoverflow.com/questions/55044473/why-i-cant-get-the-exact-same-color-when-exporting-an-image-to-jpg

Public API Changes

None

Intended Use-Case

Be able to use Maui.Graphics for basic image processing with confidence.

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.