jobtoday / react-native-image-viewing

Tiny, purely TS, modal component for viewing images 🏙
https://exp.host/@antonkalinin/react-native-image-viewing
MIT License
890 stars 290 forks source link

Orientation problem #141

Open ninjia0 opened 2 years ago

ninjia0 commented 2 years ago

if i start the app with portait mode image-viewing register it as const width so if i change the orientation to landscape, images showing half , abnormal. please fix this

liquidvisual commented 2 years ago

Having the same problem. I experience the half image problem on Android, where as iOS simply doesn't change the orientation at all when I turn my phone to landscape.

FadiAboMsalam commented 2 years ago

any update on this

chrisrodz commented 2 years ago

Seeing the same issue. Images loaded while the app is on landscape are incorrectly aligned on the screen. This affects us particularly on Android.

liquidvisual commented 2 years ago

Has anyone found a workaround or an alternate library for this? This lib has too many issues to be production friendly.

baesumin commented 2 years ago

+1

insaramalam commented 1 year ago

Is there any workaround for this issue?

Energieman commented 1 year ago

Like everyone else, i had this problem and there was no easy fix, so i changed the library completely to react-native-image-zoom-viewer' by wrapping it into a modal and this works really fine and good for me.

I do not encourage you to change your library, but if you want to, here is what i did.

import React from "react"; import { StyleSheet, Image, View, Modal } from "react-native";

import ImageViewer from 'react-native-image-zoom-viewer';

export default function Index(props) { const formattedImages = props?.arrayOfImages?.map(eachImageObj => ({url: eachImageObj.uri})) return (<Modal transparent={false} visible={props?.visible} presentationStyle={'overFullScreen'} animationType={"fade"} onRequestClose={props?.onRequestClose} supportedOrientations={["portrait", "landscape"]} hardwareAccelerated> <ImageViewer imageUrls={formattedImages} index={props?.imageIndex ?? 0} onChange={props?.onImageIndexChange} saveToLocalByLongPress={false} onSwipeDown={props?.onRequestClose} enableSwipeDown={true} backgroundColor={"#000"} doubleClickInterval={1000} /> ); }

Sanyam1432141 commented 11 months ago

view photo taken in landscape orientation, in "portrait" orientation for review, and save so it's not rotated i want to changed image path that is actually captured .