mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 21:40:00 +02:00
feat(web): deduplication UI (#9540)
This commit is contained in:
parent
832d728940
commit
57d94bce68
17 changed files with 362 additions and 2 deletions
web/src/lib/utils
|
@ -7,6 +7,7 @@ import { BucketPosition, isSelectingAllAssets, type AssetStore } from '$lib/stor
|
|||
import { downloadManager } from '$lib/stores/download';
|
||||
import { downloadRequest, getKey, s } from '$lib/utils';
|
||||
import { createAlbum } from '$lib/utils/album-utils';
|
||||
import { asByteUnitString } from '$lib/utils/byte-units';
|
||||
import { encodeHTMLSpecialChars } from '$lib/utils/string-utils';
|
||||
import {
|
||||
addAssetsToAlbum as addAssets,
|
||||
|
@ -223,6 +224,21 @@ export function isFlipped(orientation?: string | null) {
|
|||
return value && (isRotated270CW(value) || isRotated90CW(value));
|
||||
}
|
||||
|
||||
export function getFileSize(asset: AssetResponseDto): string {
|
||||
const size = asset.exifInfo?.fileSizeInByte || 0;
|
||||
return size > 0 ? asByteUnitString(size, undefined, 4) : 'Invalid Data';
|
||||
}
|
||||
|
||||
export function getAssetResolution(asset: AssetResponseDto): string {
|
||||
const { width, height } = getAssetRatio(asset);
|
||||
|
||||
if (width === 235 && height === 235) {
|
||||
return 'Invalid Data';
|
||||
}
|
||||
|
||||
return `${width} x ${height}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns aspect ratio for the asset
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue