ImageScaling
Scaling images¶
Images served through the Red Bee platform can be scaled using a couple of parameters.
Width (w)¶
By adding the query parameter w
the image's width is limited to the value of w
while otherwise keeping is aspect ratio.
Example:
https://redbee.ctl.cdn.ebsd.ericsson.net/imagescaler002/redbee/assets/0d4edda7-7122-45d8-b6f0-05b6ab22e93d_5417D6/posters/fe53cdc800db2f934892f7d210c6ab25/fe53cdc800db2f934892f7d210c6ab25.jpg?w=600
Height(h)¶
Similarly to scaling by width, images can also be scaled by height using the h
parameter.
Example:
https://redbee.ctl.cdn.ebsd.ericsson.net/imagescaler002/redbee/assets/0d4edda7-7122-45d8-b6f0-05b6ab22e93d_5417D6/posters/fe53cdc800db2f934892f7d210c6ab25/fe53cdc800db2f934892f7d210c6ab25.jpg?h=200
Cropping(crop)¶
Using both w
and h
simultaneusly will crop the image.
https://redbee.ctl.cdn.ebsd.ericsson.net/imagescaler002/redbee/assets/0d4edda7-7122-45d8-b6f0-05b6ab22e93d_5417D6/posters/fe53cdc800db2f934892f7d210c6ab25/fe53cdc800db2f934892f7d210c6ab25.jpg?h=400&w=400
By default the image scaling service will use a smart crop feature to determine how to crop. That behaviour can be overridden using the crop
parameter. Possible options are contain, cover, fill, inside, outside, smart.
Format¶
The image format can be changed using the format
paramter. This can significantly reduce the image size. Possible options are webp, jpeg, png.
NOTE: webp has limited support. Make sure whatever image format you use is supported by whatever platform you are developing for.