yourhead/stacks-bugs-and-features — Issue #250: More image scaling methods
Author: yourhead
Created: 2011-11-03 17:06:24+00:00
State: open
Labels: API, Fixed in next build, Must Have Feature

In the next build there will be 4 methods for image scaling. These are also available to imageTransforms using the key imageScaleMode.

* 0 = Scale to fit. This is the default "old" behavior. The imageScale is a percent that defines how much to scale the origin. imageMaxWidth and imageMaxHeight are used only if imageMaxWidthEnable and imageMaxHeightEnable are enabled, respectively. In this mode images will never be scaled up.
* 1 = Scale to fill. The image is scaled down to fit the imageMaxHeight and imageMaxWidth such that the entire rectangle is filled, cropping off any that falls outside the rectangle. Images will be scaled up if necessary.
* 2 = Stretch to fill. The image is stretched to fit the imageMaxHeight and imageMaxWidth such that the entire rectangle is filled with the entire original image. Images will be potentially be scaled up and distorted.
* 3 = Center. The original image is not scaled, but centered in the rectangle defined by imageMaxWidth and imageMaxHeight. If the original is smaller than the rectangle it will be centered and the remaining area will be transparent (white in JPEG). If the original is larger, then it will be cropped to fit.

Note: imageMaxHeight and imageMaxWidth are ALWAYS enabled for modes 1-3. These properties are presented to the user as merely Width and Height in these modes.