Images
Our images are resized
If the URL shows that the image is hosted in https://flockler.com/
or https://fl-cdn.scdn1.secure.raxcdn.com/
, it has been resized. You may use Flockler's thumbnail generator to resize the image to suit your needs.
Resizing images for your own needs
For example this image-url requests a 120px width image: https://flockler.com/thumbs/2931/000032_s120x0_noupscale.jpg
- Format is
[filename]_s[width]x[height](_noupscale).[file extension]
. - Noupscale in the end means that it won't be resized above its original size.
If you declare both, width and height, the image will be cropped:
https://flockler.com/thumbs/2931/000032_s480x480.jpg
Full-size images
To get a full-size image, replace /thumbs/
with /files/
in the image-url and remove the _s120x0_noupscale
part.
Full-size of our example image:
https://flockler.com/files/2931/000032.jpg
Example script to set parameters to the image-url
You might want to use a helper method like this to make it easier to play with our image-urls:
function resetResizeEngineParameters(url, width, height) {
var THUMB_PARAMS_REGEX = new RegExp("(_(s|c|l|m)\\d+x\\d+)+", "i");
var QUALITY_PARAMS_REGEX = new RegExp("_q\d+", "i");
var UPSCALE_PARAMS_REGEX = new RegExp("_noupscale", "i");
url = url.replace(THUMB_PARAMS_REGEX, "_s" + width + "x" + height)
.replace(QUALITY_PARAMS_REGEX, "")
.replace(UPSCALE_PARAMS_REGEX, "");
return url;
};
var image_url = "https://flockler.com/thumbs/2931/000032_s600x0_noupscale.jpg";
var resized_image_url = resetResizeEngineParameters(image_url, 120, 0);
// "https://flockler.com/thumbs/2931/000032_s120x0_noupscale.jpg"