Skip to content

[Android, iOS] Fix for the Resize method does not dispose the original image, even when disposeOriginal is set to true #29936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 24, 2025

Conversation

SyedAbdulAzeemSF4852
Copy link
Contributor

@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 commented Jun 11, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

  • Issue 1 : On both Android and iOS, the Resize method does not dispose of the original image, even when disposeOriginal is set to true.

Root Cause

  • Android, iOS : The original image was not being explicitly disposed, even when the disposeOriginal flag was set to true.

Description of Change

  • Android - Updated the Width and Height properties to handle null _bitmap values gracefully and added logic to dispose of the original image in the Resize method when disposeOriginal is set to true.
  • iOS - Added logic to dispose of the original image in the Resize method when disposeOriginal is set to true.

Issues Fixed

Fixes #21886 (1st issue)

Validated the behaviour in the following platforms

  • Windows
  • Android
  • iOS
  • Mac

Output

Platform Before Fix After Fix
Android
Android_Before.mov
Android_After.mov
iOS
iOS_Before.mov
iOS_After.mov

Copy link
Contributor

Hey there @@SyedAbdulAzeemSF4852! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jun 11, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz jsuarezruiz added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Jun 12, 2025
@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 marked this pull request as ready for review June 12, 2025 10:11
@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 requested a review from a team as a code owner June 12, 2025 10:11
@PureWeen PureWeen changed the base branch from main to inflight/current June 24, 2025 17:20
@PureWeen PureWeen merged commit 8c3a1be into dotnet:inflight/current Jun 24, 2025
80 checks passed
PureWeen pushed a commit that referenced this pull request Jun 25, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
github-actions bot pushed a commit that referenced this pull request Jun 26, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
PureWeen pushed a commit that referenced this pull request Jun 27, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
PureWeen pushed a commit that referenced this pull request Jun 28, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
github-actions bot pushed a commit that referenced this pull request Jun 29, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
github-actions bot pushed a commit that referenced this pull request Jun 29, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
github-actions bot pushed a commit that referenced this pull request Jul 1, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
github-actions bot pushed a commit that referenced this pull request Jul 2, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
github-actions bot pushed a commit that referenced this pull request Jul 2, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
github-actions bot pushed a commit that referenced this pull request Jul 8, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
github-actions bot pushed a commit that referenced this pull request Jul 8, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
github-actions bot pushed a commit that referenced this pull request Jul 9, 2025
…l image, even when disposeOriginal is set to true (#29936)

* Fix for original image disposal when disposeOriginal is true in Resize and Downsize methods on Android and iOS

* Updated the fix for iOS, and modified the test case to reflect the changes

* Updated the issue link in test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple bugs in Microsoft.Maui.Graphics.IImage platform specific implementations
3 participants