aboutsummaryrefslogtreecommitdiff
path: root/src/screens/moments/TagFriendsScreen.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-25 16:26:19 -0400
committerIvan Chen <ivan@tagg.id>2021-06-25 16:26:19 -0400
commit8198e4349dd589be2fbc9fb42aefaa8c5915bef5 (patch)
tree6f48168171c9c7dee1ffa74b49b3e9e4ca34fc20 /src/screens/moments/TagFriendsScreen.tsx
parenta6bc1f1a06a08bd842ba0b3bd00a88cea9bd9971 (diff)
Fix video dimension in tagging screen
Diffstat (limited to 'src/screens/moments/TagFriendsScreen.tsx')
-rw-r--r--src/screens/moments/TagFriendsScreen.tsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/screens/moments/TagFriendsScreen.tsx b/src/screens/moments/TagFriendsScreen.tsx
index 81415437..201caf49 100644
--- a/src/screens/moments/TagFriendsScreen.tsx
+++ b/src/screens/moments/TagFriendsScreen.tsx
@@ -66,7 +66,7 @@ const TagFriendsScreen: React.FC<TagFriendsScreenProps> = ({route}) => {
* Calculating image width and height with respect to it's enclosing view's dimensions. Only works for images.
*/
useEffect(() => {
- if (imageRef && imageRef.current) {
+ if (imageRef && imageRef.current && !media.isVideo) {
Image.getSize(
media.uri,
(w, h) => {
@@ -120,8 +120,13 @@ const TagFriendsScreen: React.FC<TagFriendsScreenProps> = ({route}) => {
source={{uri: media.uri}}
repeat={true}
onLoad={(response) => {
- const {width, height} = response.naturalSize;
- setMediaDimensions(width, height);
+ const {width, height, orientation} = response.naturalSize;
+ // portrait will flip width and height
+ if (orientation === 'portrait') {
+ setMediaDimensions(height, width);
+ } else {
+ setMediaDimensions(width, height);
+ }
}}
/>
</View>