Skip to content

Commit 3ee3867

Browse files
committed
fix: patch update, patch missing srcset on unpic Image component
1 parent 107609d commit 3ee3867

File tree

4 files changed

+70
-65
lines changed

4 files changed

+70
-65
lines changed

docs/src/routes/+page.svx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ images
2424
<ImageGrid>
2525
<li>
2626
<CldImage
27-
width="987"
27+
layout="fullWidth"
2828
height="1481"
2929
src="images/woman-headphones"
3030
alt="Original image of images/woman with headphones"

docs/src/routes/components/CldImage/responsive-images/+page.svx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ You can use `aspectRatio` prop instead of using both `width` and `height` at the
103103
/>
104104

105105

106-
br />
106+
<br />
107107
<br />
108108
<br />
109109

svelte-cloudinary/src/lib/components/CldImage.svelte

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,23 @@
6262
console.warn(`Failed to preserve transformations: ${(e as Error).message}`);
6363
}
6464
}
65-
$: console.log();
65+
const url = getCldImageUrl({
66+
...imageProps,
67+
...cldOptions,
68+
})
6669
</script>
6770

6871
<Image
6972
{...$$props}
7073
{...imageProps}
71-
transformer={() =>
72-
getCldImageUrl({
74+
transformer={({ width, url, height}) => {
75+
return getCldImageUrl({
7376
...imageProps,
7477
...cldOptions,
75-
...{ width: $$props.width ? $$props.width : '100%' }
78+
width,
79+
height,
80+
src:url
7681
})}
82+
}
83+
src={url}
7784
/>

svelte-cloudinary/src/routes/+page.svelte

Lines changed: 57 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,69 +5,67 @@
55
<CldImage
66
height={1200}
77
src="images/woman-headphones"
8-
crop="thumb"
98
removeBackground
109
tint="70:blue:green:purple"
1110
underlay="images/city-skyline"
1211
sizes="100vw"
1312
alt="Description of my image"
1413
layout="fullWidth"
1514
/>
16-
<CldImage
17-
width={1200}
18-
height={1200}
19-
src="images/woman-headphones"
20-
crop="thumb"
21-
removeBackground
22-
tint="70:blue:green:purple"
23-
underlay="images/city-skyline"
24-
sizes="100vw"
25-
alt="Description of my image"
26-
/>
27-
28-
<CldImage
29-
width={987}
30-
height={987}
31-
src="images/woman-headphones"
32-
sizes="50vw"
33-
crop="thumb"
34-
tint="40:253f8c"
35-
gravity="faces"
36-
underlay="images/city-skyline"
37-
overlays={[
38-
{
39-
position: {
40-
gravity: 'north',
41-
y: 60
42-
},
43-
text: {
44-
color: 'rgb:52a4ff80',
45-
fontFamily: 'Source Sans Pro',
46-
fontSize: 320,
47-
fontWeight: 'black',
48-
text: 'MUSIC',
49-
letterSpacing: -10,
50-
lineSpacing: -100,
51-
stroke: true,
52-
border: '20px_solid_rgb:2d0eff99'
53-
}
54-
},
55-
{
56-
position: {
57-
gravity: 'south',
58-
y: 60
59-
},
60-
text: {
61-
color: 'rgb:52a4ff80',
62-
fontFamily: 'Source Sans Pro',
63-
fontSize: 320,
64-
fontWeight: 'black',
65-
text: 'IS LIFE',
66-
letterSpacing: -10,
67-
lineSpacing: -100,
68-
stroke: true,
69-
border: '20px_solid_rgb:2d0eff99'
70-
}
71-
}
72-
]}
73-
/>
15+
<!-- <CldImage -->
16+
<!-- width={1200} -->
17+
<!-- height={1200} -->
18+
<!-- src="images/woman-headphones" -->
19+
<!-- crop="thumb" -->
20+
<!-- removeBackground -->
21+
<!-- tint="70:blue:green:purple" -->
22+
<!-- underlay="images/city-skyline" -->
23+
<!-- alt="Description of my image" -->
24+
<!-- /> -->
25+
<!---->
26+
<!-- <CldImage -->
27+
<!-- width={987} -->
28+
<!-- height={987} -->
29+
<!-- src="images/woman-headphones" -->
30+
<!-- sizes="50vw" -->
31+
<!-- crop="thumb" -->
32+
<!-- tint="40:253f8c" -->
33+
<!-- gravity="faces" -->
34+
<!-- underlay="images/city-skyline" -->
35+
<!-- overlays={[ -->
36+
<!-- { -->
37+
<!-- position: { -->
38+
<!-- gravity: 'north', -->
39+
<!-- y: 60 -->
40+
<!-- }, -->
41+
<!-- text: { -->
42+
<!-- color: 'rgb:52a4ff80', -->
43+
<!-- fontFamily: 'Source Sans Pro', -->
44+
<!-- fontSize: 320, -->
45+
<!-- fontWeight: 'black', -->
46+
<!-- text: 'MUSIC', -->
47+
<!-- letterSpacing: -10, -->
48+
<!-- lineSpacing: -100, -->
49+
<!-- stroke: true, -->
50+
<!-- border: '20px_solid_rgb:2d0eff99' -->
51+
<!-- } -->
52+
<!-- }, -->
53+
<!-- { -->
54+
<!-- position: { -->
55+
<!-- gravity: 'south', -->
56+
<!-- y: 60 -->
57+
<!-- }, -->
58+
<!-- text: { -->
59+
<!-- color: 'rgb:52a4ff80', -->
60+
<!-- fontFamily: 'Source Sans Pro', -->
61+
<!-- fontSize: 320, -->
62+
<!-- fontWeight: 'black', -->
63+
<!-- text: 'IS LIFE', -->
64+
<!-- letterSpacing: -10, -->
65+
<!-- lineSpacing: -100, -->
66+
<!-- stroke: true, -->
67+
<!-- border: '20px_solid_rgb:2d0eff99' -->
68+
<!-- } -->
69+
<!-- } -->
70+
<!-- ]} -->
71+
<!-- /> -->

0 commit comments

Comments
 (0)