react-native-fast-image icon indicating copy to clipboard operation
react-native-fast-image copied to clipboard

Low quality of vertical (portrait) images!

Open Omelyan opened this issue 2 years ago • 5 comments

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 avatar Mar 27 '22 21:03 Omelyan

@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}}
  ....
/>

xiaowl avatar May 07 '22 03:05 xiaowl

@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 avatar May 31 '22 14:05 Omelyan

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

xiaowl avatar Jun 01 '22 04:06 xiaowl

same issue

bodrius avatar Aug 12 '22 18:08 bodrius

I have exactly the same issue

apapalillo avatar Aug 18 '22 09:08 apapalillo

same issue

AlanWen2016 avatar Nov 16 '22 06:11 AlanWen2016

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.

pierroo avatar Dec 12 '22 12:12 pierroo