dotnet / dotnet/maui

AspectFit Fails to Preserve Image Stretching on iOS and macOS After Downsizing

Open
#30,465 5 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
area-controls-image partner/android partner/macios partner/syncfusion platform/ios platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

### Description

- While loading an embedded image resource from the application assembly, downsizing it to a maximum dimension of 100 pixels, saving it to the device’s cache directory, and displaying it using ImageSource.FromFile() in an Image control with AspectFit, the image stretched on Android and Windows but did not stretch on iOS and macOS.

| Platforms | Behaviours |
|----------|----------|
| Windows | |
| Android | |
| iOS | |
| MacOS | |

### Steps to Reproduce

1. Run the below attached sample.
2. Observe that the image stretches on Android and Windows, but not on iOS and macOS.

[SampleRepo.zip](https://github.com/user-attachments/files/21100121/SampleRepo.zip)

### Link to public reproduction project repository

_No response_

### Version with bug

9.0.70 SR7

### Is this a regression from previous behavior?

No, this is something new

### Last version that worked well

_No response_

### Affected platforms

iOS, Android, Windows, macOS

### Affected platform versions

_No response_

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.