Skip to content

[Android] XAML <image> for some webp images returned an illogical java exception. #29552

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

Open
Pipozor opened this issue May 16, 2025 · 5 comments
Labels
area-controls-image Image control platform/android s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@Pipozor
Copy link

Pipozor commented May 16, 2025

Description

The image is well valid (not corrupted, get it form source url) - see "Relevant log output" section below.

<Image x:Name="a2" Source="https://storage.googleapis.com/lidiapp/topic512/bo-Kld9lBE-1aDuSGdp-4Q_512.webp" Aspect="AspectFit" MaximumWidthRequest="512" MaximumHeightRequest="512" />

Image

Remark: it works on Windows platform. Only crash on Android.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

API 35

Did you find any workaround?

If I convert it to PNG it works (but I want to keep webp format from give url) :

<Image x:Name="a1" Source="a1.png" Aspect="AspectFit" MaximumWidthRequest="512" MaximumHeightRequest="512" />

Relevant log output

Image

Image

@Pipozor Pipozor added the t/bug Something isn't working label May 16, 2025
@Pipozor Pipozor changed the title [Android] <image> some webp images returned java exception. [Android] XAML <image> for some webp images returned an illogical java exception. May 16, 2025
@deepika2509
Copy link

This issue has been verified in Visual Studio Code 1.99.3 with MAUI versions (9.0.0, 9.0.70 & 8.0.100). It can be reproduced on Android platform.

@anandhan-rajagopal anandhan-rajagopal added platform/android s/verified Verified / Reproducible Issue ready for Engineering Triage area-controls-image Image control s/triaged Issue has been reviewed labels May 19, 2025
@PureWeen PureWeen added this to the Backlog milestone May 19, 2025
@bhavanesh2001
Copy link
Contributor

@PureWeen I think this is duplicate of #23828

@Pipozor
Copy link
Author

Pipozor commented May 22, 2025

Thanks @bhavanesh2001 , yes it is duplicated. Same issue.

@bhavanesh2001
Copy link
Contributor

bhavanesh2001 commented May 22, 2025

@Pipozor As I understand it, based on Android’s behavior, throwing the exception is expected. The underlying reason is that the image resolution is too large for the device to handle.

For a more detailed explanation, see #23828 (comment)

I recommend scaling down the image before setting it as the source.

@Pipozor
Copy link
Author

Pipozor commented May 22, 2025

@bhavanesh2001 No, image (webp) is small 512x54 pixels (see 1st post). There is a bug in handling webp (in png it works).

Probably because of MaximumWidthRequest="512" MaximumHeightRequest="512" + Aspect="AspectFit" , something get wrong it auto resize to fit 512x54 in these boundaries.

<Image x:Name="a2" Source="https://storage.googleapis.com/lidiapp/topic512/bo-Kld9lBE-1aDuSGdp-4Q_512.webp" Aspect="AspectFit" MaximumWidthRequest="512" MaximumHeightRequest="512" />

Unfortunately it is in the java code, so not easy to debug...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-image Image control platform/android s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants