Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

ImageSource.FromFile strange work #5631

Open
dronishe opened this issue Mar 20, 2019 · 1 comment
Open

ImageSource.FromFile strange work #5631

dronishe opened this issue Mar 20, 2019 · 1 comment
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!

Comments

@dronishe
Copy link

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

  1. Create new Xamarin Forms project in Visual Studio
  2. Add the same image to drawable folder and to the app folder on a virtual device
  3. Add two images with source from files from step 2.
  4. Start app on Visual Studio Android Emulator with different Xamarin Forms (3.2.0.871581 and 3.3.0.912540) versions.

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

  • Version with issue:3.3.0.912540
  • Last known good version: 3.2.0.871581
  • IDE: Visual Studio 2017, ver. 15.9.7
  • Platform Target Frameworks:
  • Affected Devices: Visual Studio Emulator for Android

Screenshots

imgsource_fine
imgsource_wrong

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.

@pauldipietro pauldipietro added this to New in Triage Mar 20, 2019
@samhouts samhouts added p/Android i/low Has trivial workaround; affects very few users i/regression e/3 🕒 3 labels Mar 22, 2019
@samhouts samhouts moved this from New to Ready For Work in Triage Mar 22, 2019
@samhouts samhouts removed this from Ready For Work in Triage Mar 27, 2019
@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Sep 17, 2019
@samhouts samhouts moved this from To do to Inactive in Android Ready For Work May 21, 2020
@samhouts samhouts added the 3.3.0 regression on 3.3.0 label Jun 17, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts added this to To do in vNext+1 (5.0.0) Aug 14, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@Confusedfish
Copy link

This sounds like a very similar issue that I am facing on an Android 10 device, physical or virtual. I don't get the problem on iOS nor Android 9.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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!
Projects
Development

No branches or pull requests

3 participants