fix: image loading stuff
Some checks failed
Deploy to SFTP Server / build (push) Failing after 3m50s
Some checks failed
Deploy to SFTP Server / build (push) Failing after 3m50s
This commit is contained in:
@@ -19,10 +19,12 @@ async function checkImage(src: string) {
|
|||||||
const res = await fetch(src);
|
const res = await fetch(src);
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}else {
|
||||||
|
console.log("Failed to fetch: ", src);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("Failed to fetch: ",src);
|
console.log("Failed to fetch: ", src);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,7 +41,7 @@ const {
|
|||||||
let thumbhash = hash && image.fsPath ? await generateThumbHash(image) : "";
|
let thumbhash = hash && image.fsPath ? await generateThumbHash(image) : "";
|
||||||
const imageOk = await checkImage(image.src);
|
const imageOk = await checkImage(image.src);
|
||||||
|
|
||||||
let exif = await getExifData(image);
|
let exif = imageOk && (await getExifData(image));
|
||||||
|
|
||||||
const sizes = [
|
const sizes = [
|
||||||
{
|
{
|
||||||
@@ -78,5 +80,5 @@ const sizes = [
|
|||||||
.join(", ")}>
|
.join(", ")}>
|
||||||
<slot />
|
<slot />
|
||||||
</AstroImage>
|
</AstroImage>
|
||||||
) : undefined
|
) : "Image not ok"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export type MemoriumEntry = MemoriumFile | MemoriumDir;
|
|||||||
export async function listResource(
|
export async function listResource(
|
||||||
id: string,
|
id: string,
|
||||||
): Promise<MemoriumEntry | undefined> {
|
): Promise<MemoriumEntry | undefined> {
|
||||||
const url = `https://marka.max-richter.dev/${id}`;
|
const url = `https://marka.max-richter.dev/resources/${id}`;
|
||||||
console.log("Fetching: ", url);
|
console.log("Fetching: ", url);
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
|
|||||||
Reference in New Issue
Block a user