Skip to main content
Version: 3.36.0

Metadata

Enumerator options for imageOptimizerOptions.metadata.

Constants

  • Copyright ("copyright") Preserve copyright notice, creator, credit line, licensor, and web statement of rights fields.
  • C2PA ("c2pa") Preserve the C2PA manifest and add any transformations performed by Fastly Image Optimizer.
  • CopyRightAndC2PA ("copyright,c2pa") Resize and crop the image centrally to exactly fit the specified region.

Examples

import { Metadata, Region } from 'fastly:image-optimizer';

addEventListener("fetch", (event) => event.respondWith(handleRequest(event)));

async function handleRequest(event) {
return await fetch('https://www.w3.org/Graphics/PNG/text2.png', {
imageOptimizerOptions: {
region: Region.UsEast,
metadata: Metadata.Copyright
},
backend: 'w3'
});
}