Resize Image
The "Resize Image" step allows you to adjust the dimensions and quality of images in your workflow. This is useful for optimizing images for various use cases such as web display, email inclusion, or social media posting.
How to Configure the Resize Image Step
Configuring the step requires setting the parameters shown below:
[IMAGE: Screenshot of the Resize Image step configuration panel]
Image URL
Enter the URL of the image you want to resize. This can be a direct image URL or a URL from a previous step in your workflow.
You can use Liquid syntax to dynamically reference an image URL from a previous step:
Width
Specify the desired width of the output image in pixels. You can set this to a specific value or use 0 to maintain the aspect ratio based on the height setting.
Height
Specify the desired height of the output image in pixels. You can set this to a specific value or use 0 to maintain the aspect ratio based on the width setting.
Format (Optional)
Select the image format for the output:
JPEG
PNG
WEBP
Each format has different characteristics:
JPEG: Best for photographs and complex images with many colors
PNG: Best for images with transparency or simple graphics
WEBP: Provides superior compression while maintaining quality
Quality (Optional)
Set the quality of the output image on a scale from 1 to 100 (with 100 being the highest quality). This setting affects the file size, with higher quality resulting in larger files.
Fit Mode (Optional)
Choose how the image should be resized:
Contain: Resize the image to fit within the specified dimensions while maintaining aspect ratio
Cover: Resize the image to cover the specified dimensions while maintaining aspect ratio (may crop)
Fill: Stretch or squash the image to exactly fit the specified dimensions
Output Format
The Resize Image step returns a JSON object containing details about the resized image:
[IMAGE: Screenshot showing an example of the resize results in the AirOps interface]
How to Use the Results
You can access the resized image properties in subsequent workflow steps using Liquid syntax. For example:
This will reference the URL of the resized image.
Common Use Cases
Optimizing images for web performance
Creating thumbnails for galleries or previews
Standardizing image dimensions across a content series
Preparing images for specific platforms (social media, email, etc.)
Reducing file size for faster loading times
How to Continue if the Resize Fails
By default, the Resize Image step will terminate the workflow if it fails. To continue the workflow if the step fails, click "Continue" at the bottom of the settings panel.
[IMAGE: Screenshot showing the "Continue" option in the step settings]
The step will return the following keys when it fails:
output
: this will benull
error
:message
: the message returned from the stepcode
: the error code representing the error
Example Workflow
Here's a common pattern using the Resize Image step:
Use "Search Stock Images" to find an appropriate image
Fetch the selected image using its ID
Use the "Resize Image" step to optimize the image for its intended use
Incorporate the resized image into your content using the output URL
This approach ensures that your images are appropriately sized for their intended purpose, improving user experience and page loading times.
Last updated
Was this helpful?