The user can specify the size of any image published in CDN by editing its URL.
1. The user should open assets on CDN using the generated link in the following format: https://cdn.metro-group.com/<countrycode>/<file name w/o extension>
2. For this purpose the user just need to edit the required width and height parameters in CDN link after "?" symbol as following:https://cdn.metro-group.com/{countrycode}/{filename}?w={width}h={height}
Example: http://cdn-pp.metro-group.com/de/de_pim_1453011001_01.png?w=300&h=400
Resized image copy is cached on CDN: resized picture is shown quicker than if image is resized to the new width and height parameters
Rendering on demand command line reference
To make image transformation from CloudFront before get them use query command line for the image processor.
Use "?" to make query after the link to the image and "&" to combine commands:
http://cdn.metro-group.com/countrycode/imagename?w=100&h=200
Sizing (and padding, autocropping, carving and stretching)
Please note that w/h/maxw/maxh commands do NOT include border, margin, or padding widths, and do not include the extra space used by rotation. They constrain the image, not the canvas.
maxw, maxh – Fit the image within the specified bounds, preserving aspect ratio.
w, h – Force the final width and/or height to certain dimensions. Whitespace will be added if the aspect ratio is different.
mode=max|pad|crop|carve|stretch -> how to handle aspect-ratio conflicts between the image and width+height:
pad adds whitespace;
crop crops minimally;
carve uses seam carving;
stretch loses aspect-ratio, stretching the image;
max behaves like maxwidth/maxheight.
anchor=topleft|topcenter|topright|middleleft|middlecenter|middleright|bottomleft|bottomcenter|bottomright. -> Anchor the image when padding or cropping.
scale=both|upscaleonly|downscaleonly|upscalecanvas – By default, images are never upscaled. Use &scale=both to upscale images if they are smaller than width and height.
zoom=0..infinity - Scale the image by a multiplier. Useful for mobile devices and situations where you need to retain all the existing width/height/crop settings, but scale the result up or down. Defaults to 1. 0.5 produces a half-size image, 2 produces a double-size image.
Output format
format=jpg|png|gif - The output format to use.
quality - Jpeg compression: 0-100 100=best, 90=very good balance, 0=ugly.
dpi=90|300|600 - The DPI at which the image should be printed. Ignored by all browsers, most operating systems, and most printers.
Advanced Filtering, see https://imageresizing.net/docs/v4/plugins/advancedfilters
Rotation & flipping
autorotate=true -> Automatically rotates the image based on the EXIF info from the camera; autorotate.default=true will only autorotate if the image is processed.
sflip=none|x|y|xy -> Flips the source image prior to processing.
srotate=0|90|180|270 -> Rotates the source image prior to processing (only 90 degree intervals).
rotate=degrees –> Rotates the image any arbitrary angle (occurs after cropping).
flip=none|x|y|xy -> Flips the image after everything is done.
Manual cropping
crop=(x1,y1,x2,y2) –> Crop the image to the specified rectangle on the source image. You can use negative coordinates to specify bottom-right relative locations.
cropxunits The width which the x1 and x2 coordinates are relative to, e.g., use '100' to make x1 and x2 percentages. Useful when you don't know the original image size.
cropyunits The height which the y1 and y2 coordinates are relative to, e.g., use '100' to make y1 and y2 percentages. Useful when you don't know the original image size.