Filter Resize
Note: this document describes the Resize filter for Instant Picture Creator v0.1
Configration & Security issues
Please take some time for filter configuration because of security issues. Please edit in filters/Resize.filter.php:
class Resize extends InstantFilter { // Security values are in pixel // value -1 means to skip the check var $security = array( "max-width"=>-1, "min-width"=>-1, "max-height"=>-1, "min-height"=>-1, "max-dim"=>-1, // maximum of dimension (x*y) "min-dim"=>-1 // minimum of dimension (x*y) );
A value of -1 disables the check for that property. All properties need a integer value, it specifies the amount of possible Pixels.
- Image width
- max-width: integer value, filtered image must have a smaller width or an error will occur
- min-width: integer value, filtered image must have a larger width or an error will occur
- Image height
- max-height: integer value, filtered image must have a smaller height or an error will occur
- min-height: integer value, filtered image must have a larger height or an error will occur
- Dimensions: it means the whole image area, you can calculate it by mulitiplication width * height
- max-dim: integer value, filtered image must have a smaller area of pixels or an error will occur
- min-dim: integer value, filtered image must have a larger area of pixels or an error will occur
It is strongly recommended to define at least maximum values (max-width, max-width, max-dim)!
How to use
You can apply the Resize filter by adding Resize-Attr01-Attr02-[Attr03] to the filter string (?filter=…).
Square extracts
?filter=Resize-square-SIDEWIDTH
Extract the centered square from an image and resize it to width/height of SIDEWIDTH pixels.
Exact width/height
?filter=Resize-exact-WIDTH-HEIGHT
Resize image to an exact WIDTH and exact HEIGHT. WIDTH and HEIGHT are pixel values.
Min
?filter=Resize-min-SIDEWIDTH
Resize the smaller image side to SIDEWIDTH pixels. It keeps the aspect ratio.
Max
?filter=Resize-max-SIDEWIDTH
Resize the larger image side to SIDEWIDTH pixels. It keeps the aspect ratio.
Height
?filter=Resize-height-HEIGHT
Resize the image height (vertical side) to HEIGHT pixels. It keeps the aspect ratio.
Width
?filter=Resize-width-WIDTH
Resize the image width (horizontal side) to WIDTH pixels. It keeps the aspect ratio.
Dim
?filter=Resize-dim-AMOUNT
Resize the image area to around AMOUNT pixels by keeping the aspect ratio. Using this with different pictures all of them will have a similar flat.
SiteInformation
Last modified: 2006-11-22 13:54 by haschek. Backlinks