Skip to content

[Android] Fixed the ImageSource.FromStream() is broken in Release builds #30785

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

Draft
wants to merge 3 commits into
base: net10.0
Choose a base branch
from

Conversation

Ahamed-Ali
Copy link
Contributor

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!

Root Cause of the issue

  • Enabling MarshalMethods causes the image to disappear in release builds. The stream object may be garbage collected or have its resources released while the native Android code is still trying to read from it, leading to image loading failures—particularly in release mode

Enabling Marshal methods

Description of Change

  • The stream is now converted to a bitmap using BitmapFactory.DecodeByteArray instead of being passed directly to PlatformInterop.LoadImageFromStream(), and the resulting image is returned correctly

Issues Fixed

Fixes #30734

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

Before Issue Fix After Issue Fix
StreamImageDisappearinrelease.mov
StreamImageSourceFixed.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jul 23, 2025
Copy link
Contributor

Hey there @@Ahamed-Ali! 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 the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jul 23, 2025
@PureWeen
Copy link
Member

/app run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants