Skip to content

Commit c844bea

Browse files
committed
Fix jpeg mime type
1 parent e869465 commit c844bea

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The image component renders into:
5858
/>
5959
<img
6060
class="cool cats"
61-
src="path/to/jpg/480"
61+
src="path/to/jpg/1920"
6262
srcset="path/to/jpg-480 480w, path/to/jpg-1024 1024w, path/to/jpg-1920 1920w"
6363
loading="lazy"
6464
decoding="async"

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zerodevx/svelte-img",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Elegant responsive images for SvelteKit",
55
"author": "Jason Lee <[email protected]>",
66
"scripts": {
@@ -24,7 +24,7 @@
2424
"devDependencies": {
2525
"@playwright/test": "^1.25.1",
2626
"@rollup/pluginutils": "^4.2.1",
27-
"@sveltejs/adapter-static": "^1.0.0-next.39",
27+
"@sveltejs/adapter-static": "1.0.0-next.39",
2828
"@sveltejs/kit": "1.0.0-next.449",
2929
"@sveltejs/package": "^1.0.0-next.3",
3030
"@tailwindcss/typography": "^0.5.4",

src/lib/SvelteImg.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ $: if (src.length) {
2323
if (group.length) {
2424
group.sort((a, b) => a.width - b.width)
2525
groups.push({
26-
format,
26+
format: format === 'jpg' ? 'jpeg' : format,
2727
srcset: group.reduce((a, c) => [...a, `${c.src} ${c.width}w`], []).join(','),
28-
src: group[0].src
28+
src: group[group.length - 1].src
2929
})
3030
}
3131
}

0 commit comments

Comments
 (0)