Fix some issues with the image hashing
This commit is contained in:
@@ -12,8 +12,6 @@ interface Props {
|
||||
const category = Astro.props.category;
|
||||
const settings = await getSettings();
|
||||
const categoryAlbums = await getCategoryAlbums(settings, category.category.url);
|
||||
|
||||
console.log(categoryAlbums);
|
||||
---
|
||||
|
||||
<div
|
||||
|
||||
@@ -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"]
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -157,7 +157,7 @@ if (page === null || page.page === null || !page.page.exists) {
|
||||
}
|
||||
}}}>
|
||||
<Fragment slot="content">
|
||||
<div>Photo</div>
|
||||
<div>{page.page.id}</div>
|
||||
</Fragment>
|
||||
</WebpageLayout>
|
||||
) }
|
||||
|
||||
Reference in New Issue
Block a user