An open-source System.Drawing.Common replacement for .NET 5 and above on all platforms. Bringing together System.Drawing, Maui, and ImageSharp's Bitmap, Image, Font, and Shape types via an agnostic free NuGet package.
Fixing in OpenTiffToImageSharp method in AnyBitmap.cs.
This PR enhances the way Tiff images are processed, particularly in handling the dimensions of each frame in a multi-frame Tiff image.
Previously, it was possible for frames to have zero width or height, which could lead to issues during processing. This PR addresses these issues in the following ways:
Non-Zero Dimensions for First Frame: The first frame of a Tiff image is now ensured to have non-zero dimensions. If the first frame has either width or height equal to zero, an exception is thrown. This validation is critical as the first frame sets the reference for other frames in the image.
Inheriting Dimensions for Subsequent Frames: For frames other than the first one, if their dimensions are zero, they will now inherit the dimensions of the first frame. This helps in maintaining consistency across frames and avoids potential issues during further processing.
By implementing these improvements, the robustness of Tiff image processing is significantly enhanced, and edge cases involving zero dimensions are effectively handled.
Fixes #45
Type of change
Please select the relevant option by placing an 'x' inside the brackets, like this: [x].
[X] 🐛 Bug fix (non-breaking change which fixes an issue)
[ ] ✨ New feature (non-breaking change which adds functionality)
[ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] 🏗️ Internal/structural update (non-breaking change that improves code quality, organization, or performance)
[ ] 📚 This change requires a documentation update
[ ] 🚀 DevOps build chain modification for release
[ ] 🤖 DevOps build chain modification for CI
How Has This Been Tested?
Try to load tiff image which has problem.
Checklist:
Please run through the checklist as much as possible and mark the items completed by placing an 'x' inside the brackets, like this: [x].
[ ] My code follows the style guidelines of this project
[X] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[X] My changes generate no new warnings
[X] I have added tests that prove my fix is effective or that my feature works
[X] New and existing unit tests pass locally with my changes
[X] I have successfully run all unit tests on Windows
[X] I have successfully run all unit tests on Linux
Description
Fixing in
OpenTiffToImageSharp
method in AnyBitmap.cs.This PR enhances the way Tiff images are processed, particularly in handling the dimensions of each frame in a multi-frame Tiff image.
Previously, it was possible for frames to have zero width or height, which could lead to issues during processing. This PR addresses these issues in the following ways:
Non-Zero Dimensions for First Frame: The first frame of a Tiff image is now ensured to have non-zero dimensions. If the first frame has either width or height equal to zero, an exception is thrown. This validation is critical as the first frame sets the reference for other frames in the image.
Inheriting Dimensions for Subsequent Frames: For frames other than the first one, if their dimensions are zero, they will now inherit the dimensions of the first frame. This helps in maintaining consistency across frames and avoids potential issues during further processing.
By implementing these improvements, the robustness of Tiff image processing is significantly enhanced, and edge cases involving zero dimensions are effectively handled.
Fixes #45
Type of change
Please select the relevant option by placing an 'x' inside the brackets, like this: [x].
How Has This Been Tested?
Try to load tiff image which has problem.
Checklist:
Please run through the checklist as much as possible and mark the items completed by placing an 'x' inside the brackets, like this: [x].