{photos
.slice(0, colCount * rowCount)
- .map((photo, index) =>
-

)}
+ .map((photo, index) => {
+ const photoWidth = imageHeight
+ ? imageHeight * photo.aspectRatio
+ : imageWidth;
+ const photoHeight = imageHeight ?? imageWidth / photo.aspectRatio;
+ const horizontalOffset = imageHeight
+ ? Math.abs((imageHeight * photo.aspectRatio - imageWidth) / 2)
+ : undefined;
+
+ return (
+
+

+
+ );
+ })}
);
}
diff --git a/src/services/postgres.ts b/src/services/postgres.ts
index b0d0f490..aabd7eb9 100644
--- a/src/services/postgres.ts
+++ b/src/services/postgres.ts
@@ -108,7 +108,7 @@ export const sqlUpdatePhotoInDb = (photo: PhotoDbInsert) =>
latitude=${photo.latitude},
longitude=${photo.longitude},
film_simulation=${photo.filmSimulation},
- priority_order=${photo.priorityOrder},
+ priority_order=${photo.priorityOrder || null},
taken_at=${photo.takenAt},
taken_at_naive=${photo.takenAtNaive},
updated_at=${(new Date()).toISOString()}
@@ -146,7 +146,7 @@ const sqlGetPhotosFromDbSortedByPriority = (
) =>
sql