This repository has been archived by the owner on May 1, 2024. It is now read-only.
ImageSource.FromFile strange work #5631
Labels
3.3.0
regression on 3.3.0
e/3 🕒
3
help wanted
We welcome community contributions to any issue, but these might be a good place to start!
i/low
Has trivial workaround; affects very few users
i/regression
inactive
Issue is older than 6 months and needs to be retested
p/Android
t/bug 🐛
up-for-grabs
We welcome community contributions to any issue, but these might be a good place to start!
Description
Setting image source from file path works differently depending on file location and on Xamarin Forms version.
The following code in xaml leads to different image sizes (see screenshots) with different Xamarin Forms versions.
<StackLayout Orientation="Vertical"> <Image Source="Octocat.png" Aspect="AspectFit"/> <Image Source= "/data/user/0/com.companyname.ImageSourceExample.Android/files/Octocat.png" Aspect="AspectFit"/> </StackLayout>
Images in drawable folder and in app folder are the same, but using Xamarin.Forms version 3.2.0.871581 (or lower) I get 2 same sized images and in version 3.3.0.912540 (or higher) I get second image much smaller.
I can reproduce this behavior only on Visual Studio Emulator for android, on real devices I have no such problem.
Steps to Reproduce
Expected Behavior
Get same images sizes for the same code independently from Xamarin Forms version.
Actual Behavior
Different images sizes for the same code for different Xamarin Forms version
Basic Information
Screenshots
Reproduction Link
https://github.com/dronishe/XamarinImagFromSourceExample
I’ve created a simple repo for reproduction. Last commit – same image size with older version of Xamarin Forms. Second to last commit – same code, differs only with Xamarin Forms version. Images have different size.
The text was updated successfully, but these errors were encountered: