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
chore: Update image API to remove maxWidth/maxHeight (#28985)
* in progress
* update tests
* remove maxHeight and maxWidth references
* add warning
* not sure how that was ever throwing tbh
* typo
* Update wording
* Fix types
* propTypes check
Co-authored-by: Matt Kane <matt@gatsbyjs.com>
@@ -316,13 +316,8 @@ The optional helper function `getImage` takes a file node and returns `file?.chi
316
316
317
317
These arguments can be passed to the `gatsbyImageData()` resolver:
318
318
319
-
-**width**: The display width of the generated image. The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities. Ignored if layout = FLUID or CONSTRAINED, where you should use "maxWidth" instead.
319
+
-**width**: The display width of the generated image for layout = FIXED, if layout = CONSTRAINED it's the display width of the largest generated image. The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities.
320
320
-**height**: If set, the height of the generated image. If omitted, it is calculated from the supplied width, matching the aspect ratio of the source image.
321
-
-**maxWidth**:
322
-
Maximum display width of generated files.
323
-
The actual largest image resolution will be this value multiplied by the largest value in outputPixelDensities
324
-
This only applies when layout = FLUID or CONSTRAINED. For other layout types, use "width"
325
-
-**maxHeight**: If set, the generated image is a maximum of this height, cropping if necessary. If the image layout is "constrained" then the image will be limited to this height. If the aspect ratio of the image is different than the source, then the image will be cropped.`,
326
321
-**placeholder**: Format of generated placeholder image.
327
322
-`BLURRED`: (default) a blurred, low resolution image, encoded as a base64 data URI
328
323
-`TRACED_SVG`: a low-resolution traced SVG of the image.
@@ -333,7 +328,7 @@ These arguments can be passed to the `gatsbyImageData()` resolver:
333
328
-`FIXED`: A static image size, that does not resize according to the screen width
334
329
-`FLUID`: The image resizes to fit its container. Pass a "sizes" option if it isn't going to be the full width of the screen.
335
330
-**outputPixelDensities**: A list of image pixel densities to generate, for high-resolution (retina) screens. It will never generate images larger than the source, and will always include a 1x image.
336
-
Default is `[ 0.25, 0.5, 1, 2 ]`, for fluid/constrained images, and `[ 1, 2 ]` for fixed. In this case, an image with a fluid layout and maxWidth = 400 would generate images at 100, 200, 400 and 800px wide
331
+
Default is `[ 0.25, 0.5, 1, 2 ]`, for fluid/constrained images, and `[ 1, 2 ]` for fixed.
337
332
-**sizes**: The "[sizes](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images)" attribute, passed to the `<img>` tag. This describes the display size of the image. This does not affect the generated images, but is used by the browser to decide which images to download. You can leave this blank for fixed images, or if the responsive image container will be the full width of the screen. In these cases we will generate an appropriate value. If, however, you are generating responsive images that are not the full width of the screen, you should provide a sizes property for best performance. You can alternatively pass this value to the component.
338
333
-**formats**: an array of file formats to generate. The default is `[AUTO, WEBP]`, which means it will generate images in the same format as the source image, as well as in the next-generation [WebP](https://developers.google.com/speed/webp) format. We strongly recommend you do not change this option, as doing so will affect performance scores.
339
334
-**quality**: The default quality. This is overridden by any format-specific options
0 commit comments