File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ Change format to `webp` and keep other things same as source:
95
95
96
96
` /f_webp/static/buffalo.png `
97
97
98
+ Automatically convert to a preferred format (avif/webp/jpeg). Uses the browsers ` accept ` header to negotiate:
99
+
100
+ ` /f_auto/static/buffalo.png `
101
+
98
102
Keep original format (` png ` ) and set width to ` 200 ` :
99
103
100
104
` /w_200/static/buffalo.png `
Original file line number Diff line number Diff line change @@ -64,9 +64,12 @@ export function createIPXH3Handler(ipx: IPX) {
64
64
const mFormat = modifiers . f || modifiers . format ;
65
65
if ( mFormat === "auto" ) {
66
66
const acceptHeader = getRequestHeader ( event , "accept" ) || "" ;
67
+ const animated = modifiers . animated ?? modifiers . a ;
67
68
const autoFormat = autoDetectFormat (
68
69
acceptHeader ,
69
- ! ! ( modifiers . a || modifiers . animated ) ,
70
+ // #234 "animated" param adds {animated: ''} to the modifiers
71
+ // TODO: fix modifiers to normalized to boolean
72
+ ! ! animated || animated === "" ,
70
73
) ;
71
74
delete modifiers . f ;
72
75
delete modifiers . format ;
You can’t perform that action at this time.
0 commit comments