You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(handlers): clamp output dimensions with maxOutputDimension option
Requested resize/width/height dimensions and extend edges are now capped
to a configurable maximum output dimension (default 8192) to prevent
memory exhaustion via requests like /enlarge,s_20000x20000/img.jpg.
Set maxOutputDimension: false to disable.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,6 +193,9 @@ You can universally customize IPX configuration using `IPX_*` environment variab
193
193
194
194
-`IPX_ALIAS`
195
195
- Default: `{}`
196
+
-`IPX_MAX_OUTPUT_DIMENSION`
197
+
- Default: `8192`
198
+
- Maximum width and height (in pixels) of the output image (option: `maxOutputDimension`). Requested `width`, `height` and `resize` dimensions are clamped to it, preserving the requested aspect ratio, and `extend` edges are clamped so the extended canvas stays within it. This bounds how much memory a single request can allocate: sharp only limits the _input_ size, so without it `/enlarge,s_20000x20000/image.jpg` (or `/extend_10000_10000_10000_10000/image.jpg`) allocates gigabytes from a small source image. Set to `false` to disable, which is only safe when modifiers come from a trusted source.
0 commit comments