1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-26 10:50:29 +02:00

fix(web): aspect ratio for photos with Rotate 270 CW orientation (#3003)

* fix(web): aspect ratio for photos with Rotate 270 CW orientation

* Remove checks assuming we can have only numeric values

* Remove the -90 value check for the orientation

* Add comment to numeric values of the orientation tag
This commit is contained in:
Sergey Kondrikov 2023-06-28 21:04:32 +03:00 committed by GitHub
parent add5219d34
commit 86562f256f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -39,13 +39,7 @@
return [thumbnailWidth, thumbnailHeight]; return [thumbnailWidth, thumbnailHeight];
} }
if (asset.exifInfo?.orientation === 'Rotate 90 CW') {
return [176, 235];
} else if (asset.exifInfo?.orientation === 'Horizontal (normal)') {
return [313, 235];
} else {
return [235, 235]; return [235, 235];
}
})(); })();
const thumbnailClickedHandler = () => { const thumbnailClickedHandler = () => {

View File

@ -189,7 +189,8 @@ export function getAssetRatio(asset: AssetResponseDto) {
let width = asset.exifInfo?.exifImageWidth || 235; let width = asset.exifInfo?.exifImageWidth || 235;
const orientation = Number(asset.exifInfo?.orientation); const orientation = Number(asset.exifInfo?.orientation);
if (orientation) { if (orientation) {
if (orientation == 6 || orientation == -90) { // 6 - Rotate 90 CW, 8 - Rotate 270 CW
if (orientation == 6 || orientation == 8) {
[width, height] = [height, width]; [width, height] = [height, width];
} }
} }