Search
Loading...
Skip to content

Page Format

By default, the CreativeEditor SDK ships with an extensive list of commonly used formats, as shown below:

The CE.SDK can be configured with a series of crop presets by updating the content.json from the default asset source - ly.img.page.presets - on your CDN. For further reference, please take a look at the “Serve Assets” section here.

To enable the CE.SDK defaults enable our default asset sources by using addDefaultAssetSources.

let baseURL = URL(string: "YOUR_CDN_URL")!
try await engine.addDefaultAssetSources(baseURL: baseURL)

Configuring Custom Page Formats#

When overriding the content.json with your custom crop presets each of the assets in the asset source must define a value for its payload.transformPreset property.

When a fixed size preset is applied, the pages of the scene will be resized to the specified width and height.

{
"id": "page-sizes-instagram-square",
"label": {
"en": "Square Post (1:1)",
"de": "Quadratischer Post (1:1)"
},
"meta": {
"thumbUri": "{{base_url}}/ly.img.page.presets/thumbnails/instagram/ig-square.png"
},
"payload": {
"transformPreset": {
"type": "FixedSize",
"width": 1080,
"height": 1080,
"designUnit": "Pixel"
}
},
"groups": ["instagram"]
}
  • type - specifies the preset type.
"type": "FixedSize"
  • width - specifies the width of the page in the specified design unit.
"width": 1280
  • height specifies the height of the page in the specified design unit.
"height": 720
  • unit describes unit in which width and height are specified. This can either be Millimeter, Inch or Pixel.
"designUnit": "Pixel"