Fix issue #530: Image Optimization for remote Images does not work
This commit is contained in:
@@ -41,15 +41,12 @@ const _image = await findImage(props.src);
|
|||||||
|
|
||||||
let image: ImageType | undefined = undefined;
|
let image: ImageType | undefined = undefined;
|
||||||
|
|
||||||
if (typeof _image === 'string') {
|
if (
|
||||||
if ((_image.startsWith('http://') || _image.startsWith('https://')) && isUnpicCompatible(_image)) {
|
typeof _image === 'string' &&
|
||||||
|
(_image.startsWith('http://') || _image.startsWith('https://')) &&
|
||||||
|
isUnpicCompatible(_image)
|
||||||
|
) {
|
||||||
image = await getImagesOptimized(_image, props, unpicOptimizer);
|
image = await getImagesOptimized(_image, props, unpicOptimizer);
|
||||||
} else {
|
|
||||||
image = {
|
|
||||||
src: _image,
|
|
||||||
attributes: { ...props, src: undefined },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else if (_image) {
|
} else if (_image) {
|
||||||
image = await getImagesOptimized(_image, props, astroAsseetsOptimizer);
|
image = await getImagesOptimized(_image, props, astroAsseetsOptimizer);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user