mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 21:07:49 +00:00
fix: image loading on odd sizes now works
This commit is contained in:
@@ -3,7 +3,7 @@ import {
|
||||
GetPictureParams,
|
||||
GetPictureResult,
|
||||
} from "@astrojs/image/dist/lib/get-picture";
|
||||
import sharp_service from "../../../node_modules/@astrojs/image/dist/loaders/sharp.js";
|
||||
import squoosh_service from "../../../node_modules/@astrojs/image/dist/loaders/squoosh.js";
|
||||
|
||||
export function getPicture(
|
||||
params: GetPictureParams
|
||||
@@ -11,8 +11,8 @@ export function getPicture(
|
||||
// HACK: This is a hack that heavily relies on `getImage`'s internals :(
|
||||
globalThis.astroImage = {
|
||||
...(globalThis.astroImage || {}),
|
||||
loader: globalThis.astroImage?.loader ?? sharp_service,
|
||||
defaultLoader: globalThis.astroImage?.defaultLoader ?? sharp_service,
|
||||
loader: globalThis.astroImage?.loader ?? squoosh_service,
|
||||
defaultLoader: globalThis.astroImage?.defaultLoader ?? squoosh_service,
|
||||
};
|
||||
|
||||
return astroImage.getPicture(params);
|
||||
|
||||
Reference in New Issue
Block a user