Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/components/AvatarCropModal/AvatarCropModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,17 @@ function AvatarCropModal({imageUri = '', imageName = '', imageType = '', onClose
if (!imageUri) {
return;
}
ImageSize.getSize(imageUri).then(({width, height}) => {
// We need to have image sizes in shared values to properly calculate position/size/animation
originalImageHeight.value = height;
originalImageWidth.value = width;
// We need to have image sizes in shared values to properly calculate position/size/animation
ImageSize.getSize(imageUri).then(({width, height, rotation: orginalRotation}) => {
// On Android devices ImageSize library returns also rotation parameter.
if (orginalRotation === 90 || orginalRotation === 270) {
originalImageHeight.value = width;
originalImageWidth.value = height;
} else {
originalImageHeight.value = height;
originalImageWidth.value = width;
}

setIsImageInitialized(true);

// Because the reanimated library has some internal optimizations,
Expand Down