Thumbnailer v0.2 by Manu <m.chardonnens@gmail.com>
- Selecting File:
- usage: ?file=FILENAME // Files in relative server directory or some http://address images. GIF, PNG, JPG or BMP.
- Benchmarking: usage: ?bench&OTHER_OPTIONS // Will display the elapsed time to apply selected operations, but won't show the image.
- Resizing options:
- ratio usage: ?ratio=148 // Will resize the image to fit in a square of the given ratio.
- width and/or height
- usage:
- ?width=320&height=240 // Will resize the image to the given width and height.
- ?width=320 // Will resize the image to the given width and calculate height to constrain image proportions.
- ?height=240 // Will resize the image to the given height and calculate width to constrain image proportions.
- max_width and/or max_height
- usage:
- ?max_width=320&max_height=240 // Will resize the image to fit in a rectangle of the given max dimensions.
- ?max_width=320 // Will resize the image to the given width (if the initial width is bigger) and calculate height to constrain image proportions.
- ?max_height=240 // Will resize the image to the given height (if the initial height is bigger) and calculate width to constrain image proportions.
- Effects:
- greyscale
- usage: ?greyscale // Will convert the image to greyscale.
- invert
- usage: ?invert // Will invert the colors in the image.
- color_filter
- usage: ?color_filter=COLOR_R,COLOR_G,COLOR_B // Will apply a color filter on the image.
- exemples:
- unsharp_mask
- usage: ?unsharp_mask=AMOUNT,RADIUS,THRESHOLD // Will apply a sharpening filter on the image.
- The Amount parameter simply says how much of the effect you want. 100 is 'normal'.
- Radius is the radius of the blurring circle of the mask.
- 'Threshold' is the least
difference in colour values that is allowed between the original and the mask. In practice
this means that low-contrast areas of the picture are left unrendered whereas edges
are treated normally. This is good for pictures of e.g. skin or blue skies.
- exemple: ?unsharp_mask=80,0.5,3
- flip
- usage: ?flip=FLIP_ORIENTATION
- exemples:
- colors_nb
- usage: ?colors_nb=NUMBER&OPTIONS // Sets the maximum number of colors that should be retained in the palette of the image.
- options:
- dither // Indicates if the image should be dithered - if it is TRUE then dithering will be used which will result in a more speckled image but with better color approximation.
- exemples:
- Options:
- output_format
- usage: ?output_format=IMAGE_TYPE // Let the user choose the output format of the image.
parameters: gif, png, jpg
- exemple: ?output_format=jpg // Will create a JPG file.
- exemple: ?output_format=png // Will create a PNG file.
- display
- usage: ?display=OPTION // Let the user choose if the file has to be displayed.
- options: true, false
- store
- usage: ?store&OPTIONS // Will store the output image (by default overwriting the existing one).
- options:
- prefix // Indicates the prefix of the stored image ( __PREFIX__filname.ext ).
- preext // Indicates the pre-extension of the stored image ( filname__PREEXT__.ext ).
- store_path // The relative or absolute path to the directory you want to store the thumb (folder must be on the same server as this script and needs to be chmoded so that group can execute and write in!).
- exemples:
- ?store // Will override the given image.
- ?store&prefix=th_ // Will create a file ( th_FILENAME.EXT ) in the same folder of the image.
- ?store&preext=.thumb // Will create a file ( FILENAME.thumb.EXT ) in the same folder of the image.
- Combining: