-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: pixel density #572
Comments
+1 I have the same problem |
Can you check if this happens with 5.0.5? |
@benmccann Same issue in 5.0.5. // ?w=400&format=webp&as=picture&density=100;200
{
"sources": {
"webp": [
{
"src": "/@imagetools/5ccabd5fe6fbf6f21048ddbb136dde28284f273a", // pixel width is 400px
"w": 400
},
{
"src": "/@imagetools/f491484c76fc44e8c8d84eb7cdef3c4a6749c4e5", // pixel width is also 400px, expected 800
"w": 400
}
]
},
"img": {
"src": "/@imagetools/5ccabd5fe6fbf6f21048ddbb136dde28284f273a",
"w": 400,
"h": 237
}
} |
Actually, I noticed there's no such thing as a So I'm not sure where you got the idea that such a directive exists? |
@benmccann It's been months since I've touched this, I don't recall. Sorry Looking forward to the official SvelteKit image component or function. |
Super useful lib. Nice work.
My goal is to create a picture element with pixel density specified in srcset. Roughly like this simple example:
Problems:
Providing the
?density=100;200
increases the # of returned image paths, as expected. For example,import control from '$lib/assets/images/ocean.jpg?w=400;1000&format=webp&density=100;200';
returns:But upon opening the image files directly, to compare the two AVIFs for example,
/@imagetools/60da27e81d9c7b670d3a08f9bbdff95bfbedffb5
vs/@imagetools/128eced088ace9a80f6c72c22a913f3c34e7e0fe
, both have the same actual pixel dimensions. I was expecting one to be 800px.It'd be helpful if the response image objects contained a
density
property for clarity and easier handling, when the density query parameter property is provided.The text was updated successfully, but these errors were encountered: