Based on how images are resized, it seems like the default behavior of the ‘fit’ parameter is ‘scale-down’ (see the excerpt from the docs below). Currently my worker does not set a value for the fit parameter. When I try to resize an image with a width/height that is bigger than the original image, the image is not enlarged. This makes me think that the default behavior for ‘fit’ if this parameter is not set is ‘scale-down’ . Can anyone from Cloudflare confirm this?
From the docs https://developers.cloudflare.com/images/image-resizing/resize-with-workers/#fit
:
fit
Affects interpretation of width
and height
. All resizing modes preserve aspect ratio. Used as a string in Workers integration. Available modes are:
-
scale-down
Similar tocontain
, but the image is never enlarged. If the image is larger than givenwidth
orheight
, it will be resized. Otherwise its original size will be kept. Example: