Add Colored Background with Repurpose Action

In this example an image is resized, given padding based on certain repurpose parameters, then exported as a view. This AutoTask only applies to image formats.

<task>
  <matchCriteria>
    <criteria type="action" value="resync"></criteria>
  </matchCriteria>
  <repurpose background="white" extent="1000,1000" format="jpg" height="800" width="800"></repurpose>
  <exports>
    <export name="Background extent test" type="view"></export>
  </exports>
</task>

matchCriteria

In this example, the task is triggered when an asset is resynced

repurpose

The repurpose parameters: 

  • background: Defines the color of the padding around the image; the only accepted parameter is white
  • extent: The dimensions of the final view, in this case 1000x1000 pixels. Any asset smaller than those dimensions or those sized down using the width/height parameters will receive a white background padding the image to 1000x1000 pixels. 
  • format: The file format of the output view. This must be an image format.
  • height/width: The height and/or width of the repurposed asset, once it has been repurposed. If only one parameter is present, the image will scale accordingly. If both parameters are present, the image will be sized according to both parameters then placed into the padded view according to the extent parameter. If these parameters exceed the extent's value on either size, the image will not receive padding and will simply resize according to the preset extent dimensions. 

export

The final result of the repurpose action is exported as a view of the original, resynced asset. 

Was this article helpful?
0 out of 0 found this helpful