pockethost/patches/@sveltejs%2Fenhanced-img@0.4.4.patch
Ben Allfree d2961e67b1 wip
2025-07-19 17:56:48 -07:00

27 lines
873 B
Diff

diff --git a/src/preprocessor.js b/src/preprocessor.js
index eef343b2dda0dedd63012214a1ba6b82fe86195b..b388ada0bd471c3d90b3f59d0ad23d2ae6269c76 100644
--- a/src/preprocessor.js
+++ b/src/preprocessor.js
@@ -320,8 +320,8 @@ function img_to_picture(content, node, image) {
res += `<img ${serialize_img_attributes(content, attributes, {
src: to_value(image.img.src),
- width: image.img.w,
- height: image.img.h
+ width: image.img.w / 2,
+ height: image.img.h / 2
})} />`;
return (res += '</picture>');
@@ -354,8 +354,8 @@ function dynamic_img_to_picture(content, node, src_var_name) {
const details = {
src: `{${src_var_name}.img.src}`,
- width: `{${src_var_name}.img.w}`,
- height: `{${src_var_name}.img.h}`
+ width: `{${src_var_name}.img.w / 2}`,
+ height: `{${src_var_name}.img.h / 2}`
};
return `{#if typeof ${src_var_name} === 'string'}