Resize Images
Resize image width
https://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.jpg?environment={environment_name}&width={width_value}Additional Notes
- In case the dimensions specified for the output image is greater than the dimensions of the input image, the image will be upscaled.
- To disable upscaling, use the disable=upscale parameter.
- To specify a width more than 100% of the original image, use the p parameter. For example, to get a width of 250%, use width=250p.
Note Check out the limitations that are applicable here.
The width parameter lets you dynamically resize the width of the output image by specifying pixels or percentage values. To specify pixel width, use any positive integer between 1 and 8192. For percentage width, use any value between 0.0 and 0.99. To get image width of more than 99 percent, use a value above 99 and append a p parameter to the value. For example, for image width of 300 percent, use width=300p.
The width parameter will automatically adjust the height of the image using the aspect ratio of the image. If the height parameter is specified, the given value will be used. And if both the height and the width parameters are not specified, the dimensions of the input image will be used.
In case the dimensions specified for the output image is greater than the dimensions of the input image, the image will be upscaled. You can disable upscaling of the image by using the disable=upscale parameter.
Note Currently, the width parameter doesn't work for GIF files as it affects their quality.
Resize image height
https://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.jpg?environment={environment_name}&height={height_value}Additional Notes
- In case the dimensions specified for the output image is greater than the dimensions of the input image, the image will be upscaled.
- To disable upscaling, use the disable=upscale parameter.
- To specify a height of more than 100% of the original image, use the p parameter. For example, to get a height of 250%, use height=250p.
Note Check out the limitations that are applicable here.
The height parameter lets you dynamically resize the height of the output image by specifying pixels or percentage values. To specify pixel height, use any positive integer between 1 and 8192. For percentage height, use any value between 0.0 and 0.99. To get image height of more than 99 percent, use a value above 99 and append a p parameter to the value. For example, for image height of 300 percent, use height=300p.
The height parameter will automatically adjust the width of the image using the aspect ratio of the image. If the width parameter is specified, the given value will be used. And if both the height and the width parameters are not specified, the dimensions of the input image will be used.
In case the dimensions specified for the output image is greater than the dimensions of the input image, the image will be upscaled. You can disable upscaling of the image by using the disable=upscale parameter.
Note Currently, the height parameter doesn't work for GIF files as it affects their quality.
Disable upscaling of image
https://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.jpg?environment={environment_name}&width={value}&disable={value}To see this parameter in action, the height or width (or both) parameter should be used with it.
Note Check out the limitations that are applicable here.
The disable parameter disables the functionality that is enabled by default. For instance, upscale is always enabled, in which the image is upscaled if the output image (by specifying the width or height) is bigger than the source image. To disable this feature, you can use the query ?disable=upscale. This ensures that even if the specified height or width is much bigger than the actual image, it will not be rendered disproportionately.
As of now, there is only one value, i.e., upscale, that you can use with the disable parameter.