Skip to main content
PESDK/Web/Configuration
Language:

Engine Configuration Settings of PhotoEditor SDK

In this example, we will show you how to configure the PhotoEditor SDK.

Engine Configuration#

The PE.SDK comes with a set of configuration parameters that let's you restrict the maximum dimensions of the loaded image.

index.js
engine: {
crossOrigin: 'anonymous',
downscaleOptions: {
maxMegaPixels: {
desktop: 10,
mobile: 5,
},
maxDimensions: {
height: 1920,
width: 1080,
},
},
},

crossOrigin string#

Sets the global crossOrigin loading mode. Available are anonymous, use-credentials or none.

index.js
crossOrigin: 'anonymous',

downscaleOptions object#

Images whose sizes exceed these megapixel limits will be downscaled by the engine.

index.js
downscaleOptions: {
maxMegaPixels: {
desktop: 10,
mobile: 5,
},
maxDimensions: {
height: 1920,
width: 1080,
},
},

maxMegaPixels object#

Specifies the maximum amount of megapixels per device type.

index.js
maxMegaPixels: {
desktop: 10,
mobile: 5,
},

desktop number#

Limits the maximum megapixels on a desktop device.

index.js
desktop: 10,

mobile number#

Limits the maximum megapixels on a mobile device.

index.js
mobile: 5,

maxDimensions object#

Specifies max height or width for the image.

index.js
PhotoEditorSDK.PhotoEditorSDKUI.init({
license: '',
container: '#editor',
image: 'https://images.unsplash.com/...',
engine: {
crossOrigin: 'anonymous',
downscaleOptions: {
maxMegaPixels: {
desktop: 10,
mobile: 5,
},
maxDimensions: {
height: 1920,
width: 1080,
},
},
},
});

height number#

Defaults to height of given image

index.js
height: 1920,

width number#

Defaults to width of given image

index.js
width: 1080,
File:
PhotoEditorSDK.PhotoEditorSDKUI.init({
license: '',
container: '#editor',
image: 'https://images.unsplash.com/...',
engine: {
crossOrigin: 'anonymous',
downscaleOptions: {
maxMegaPixels: {
desktop: 10,
mobile: 5,
},
maxDimensions: {
height: 1920,
width: 1080,
},
},
},
});