mirror of
https://github.com/immich-app/immich.git
synced 2026-01-28 15:55:03 -08:00
Compare commits
2 Commits
feat/verif
...
fix-migrat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99a8740f1b | ||
|
|
a781c78caf |
@@ -98,7 +98,12 @@ class AssetService {
|
||||
height = fetched?.height?.toDouble();
|
||||
}
|
||||
|
||||
return (width: width, height: height, isFlipped: false);
|
||||
// Check exif for orientation to determine if dimensions should be flipped
|
||||
// This is important for videos where raw file dimensions may not match display dimensions
|
||||
final exif = await _remoteAssetRepository.getExif(asset.id);
|
||||
final isFlipped = exif?.isFlipped ?? false;
|
||||
|
||||
return (width: width, height: height, isFlipped: isFlipped);
|
||||
}
|
||||
|
||||
Future<List<(String, String)>> getPlaces(String userId) {
|
||||
|
||||
@@ -284,12 +284,16 @@ Future<void> _syncLocalAlbumIsIosSharedAlbum(Drift db) async {
|
||||
|
||||
Future<void> _backfillAssetExifWidthHeight(Drift db) async {
|
||||
try {
|
||||
// Only backfill images (type = 1), not videos
|
||||
// Videos have different dimension handling based on orientation/exif
|
||||
await db.customStatement('''
|
||||
UPDATE remote_exif_entity AS remote_exif
|
||||
SET width = asset.width,
|
||||
height = asset.height
|
||||
FROM remote_asset_entity AS asset
|
||||
WHERE remote_exif.asset_id = asset.id;
|
||||
WHERE remote_exif.asset_id = asset.id
|
||||
AND asset.type = 1
|
||||
AND (remote_exif.width IS NULL OR remote_exif.width = 0 OR remote_exif.height IS NULL OR remote_exif.height = 0);
|
||||
''');
|
||||
|
||||
dPrint(() => "[MIGRATION] Successfully backfilled asset exif width and height");
|
||||
|
||||
@@ -118,7 +118,13 @@ abstract final class TestUtils {
|
||||
return result;
|
||||
}
|
||||
|
||||
static domain.RemoteAsset createRemoteAsset({required String id, int? width, int? height, String? ownerId}) {
|
||||
static domain.RemoteAsset createRemoteAsset({
|
||||
required String id,
|
||||
int? width,
|
||||
int? height,
|
||||
String? ownerId,
|
||||
String? localId,
|
||||
}) {
|
||||
return domain.RemoteAsset(
|
||||
id: id,
|
||||
checksum: 'checksum1',
|
||||
@@ -132,6 +138,7 @@ abstract final class TestUtils {
|
||||
width: width,
|
||||
height: height,
|
||||
isEdited: false,
|
||||
localId: localId,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user