Fix some issues with the image hashing

This commit is contained in:
itsfinniii
2026-04-05 22:10:06 +02:00
parent 5c161b8381
commit f95f792775
4 changed files with 10 additions and 20 deletions

View File

@@ -59,15 +59,12 @@ export async function getAllAlbums(settings: GlobalSettings): Promise<PhotoAlbum
};
albumRecord["photos"].forEach((photoRecord: any) => {
const imageSize =
getImageSize(photoRecord["photo"]["width"], photoRecord["photo"]["height"], 0.8);
album.photos.push({
id: photoRecord["id"],
photo: {
url: photoRecord["photo"]["filename_disk"],
width: imageSize.width,
height: imageSize.height
width: photoRecord["photo"]["width"],
height: photoRecord["photo"]["height"]
},
text: photoRecord["text"]
});
@@ -145,15 +142,12 @@ export async function getAlbum(settings: GlobalSettings, route: string): Promise
};
albumRecord["photos"].forEach((photoRecord: any) => {
const imageSize =
getImageSize(photoRecord["photo"]["width"], photoRecord["photo"]["height"], 0.8);
album.photos.push({
id: photoRecord["id"],
photo: {
url: photoRecord["photo"]["filename_disk"],
width: imageSize.width,
height: imageSize.height
width: photoRecord["photo"]["width"],
height: photoRecord["photo"]["height"]
},
text: photoRecord["text"]
});
@@ -228,15 +222,12 @@ export async function getLastAlbums(amount: number) {
};
albumRecord["photos"].forEach((photoRecord: any) => {
const imageSize =
getImageSize(photoRecord["photo"]["width"], photoRecord["photo"]["height"], 0.8);
album.photos.push({
id: photoRecord["id"],
photo: {
url: photoRecord["photo"]["filename_disk"],
width: imageSize.width,
height: imageSize.height
width: photoRecord["photo"]["width"],
height: photoRecord["photo"]["height"]
},
text: photoRecord["text"]
});
@@ -323,8 +314,8 @@ export async function getCategoryAlbums(settings: GlobalSettings, route: string)
id: photoRecord["id"],
photo: {
url: photoRecord["photo"]["filename_disk"],
width: imageSize.width,
height: imageSize.height
width: photoRecord["photo"]["width"],
height: photoRecord["photo"]["height"]
},
text: photoRecord["text"]
});

View File

@@ -16,6 +16,7 @@ export async function getPhotoFromHash(albumUrl: string, hash: string): Promise<
* I have decided to not put the getImageSize here, it can mess up the
* hashing, or anything else. It seems smarter to do this in the photo's and galleries.
*/
const hashObject = md5(JSON.stringify({
id: photo.id,
url: photo.photo.filename_disk,