Skip to content
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

Low quality of vertical (portrait) images! #887

Open
Omelyan opened this issue Mar 27, 2022 · 7 comments
Open

Low quality of vertical (portrait) images! #887

Omelyan opened this issue Mar 27, 2022 · 7 comments
Labels

Comments

@Omelyan
Copy link

Omelyan commented Mar 27, 2022

Describe the bug
Vertical images are rendered at low resolution in horizontal container when loaded from cache. At the same time, everything is ok when filling the vertical container.
This problem has been around for a long time. See #658, #545, #850...
An image display component that cannot properly display an image. Hey!

Screenshots

<FastImage
  source={{ uri }}
  resizeMode={FastImage.resizeMode.cover}
  style={{ height: 160, width: 320 }}
/>

image


<FastImage
  source={{ uri }}
  resizeMode={FastImage.resizeMode.cover}
  style={{ height: 500, width: 320 }}
/>

image

Dependency versions

  • React Native version: 0.66.4
  • React Native Fast Image version: 8.5.11
  • Android API 29
@Omelyan Omelyan added the bug label Mar 27, 2022
@xiaowl
Copy link

xiaowl commented May 7, 2022

@Omelyan I believe this issue is caused by that the order of property updates is RANDOM as RN using Maps to pass properties. soruce always being set before resizeMode, then Glide will using FIT_CENTER to loading and later the ImageView using CENTER_CROP to display.

Workaround I used:

const [uri, setUri] = useState('');
useEffect(() => {
    setUri(item.uri);
}, []);

<FastImage
  source={{uri: uri}}
  ....
/>
@Omelyan Omelyan closed this as completed May 31, 2022
@Omelyan Omelyan reopened this May 31, 2022
@Omelyan
Copy link
Author

Omelyan commented May 31, 2022

@xiaowl that's great, but I'm talking about an image displaying component that can't display a vertical image properly, and this issue has been around for years.
Maybe it should be renamed to FastHorizontalImage..?

@Omelyan Omelyan changed the title Low quality for vertical images! May 31, 2022
@xiaowl
Copy link

xiaowl commented Jun 1, 2022

Maybe I can make a pull request trying to fix this isse.

@bodrius
Copy link

bodrius commented Aug 12, 2022

same issue

@apapalillo
Copy link

I have exactly the same issue

@Omelyan Omelyan changed the title Low quality for vertical (portrait) images! Aug 18, 2022
@AlanWen2016
Copy link

same issue

@pierroo
Copy link

pierroo commented Dec 12, 2022

By any chance, is that "displaying image component" react-native-lightbox-v2 @Omelyan ?
I am facing the same issue with this library when it contains a fastImage, and for some reason when I close the ligthbox view, re-open it right away: then the image is no longer "low quality looking". Magic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6 participants