thumbGen
This plugin is made for developers. It creates a function named thumbGen() that allows to show any image in the specified size. Additionally you can specify values like crop, center, rotation and effects. It saves all generated thumbs in a cache folder, so it won’t overload your server at all. Usage
This plugin is made for developers.
It creates a function named thumbGen() that allows to show any image in the specified size. Additionally you can specify values like crop, center, rotation and effects.
It saves all generated thumbs in a cache folder, so it won’t overload your server at all.
Usage
To use this function you just need to use this line code:
<?php thumbGen(image,width,height,additional_parameters); ?>
[image:] the URL of the original image you need to create a thumbnail from (needed).
[width:] the width you need for the generated thumbnail (default=0 – if not specified it gets the proportional value from the specified height).
[height:] the height you need for the generated thumbnail (default=0 – if not specified it gets the proportional value from the specified width).
note: if you don’t specify the with AND height (or if you set both to 0), the image will be generated in the source size.
Additional parameters
[filename:] some people have troubles with duplicated names, so I’ve added this parameter for you to specify a new filename (or ID or something like that) in order to differentiate each file (if not set it will use the source filename).
[md5:] by default, the images are generated with an md5 encode filename. If you don’t want the generated file to have an encoded name set this to 0
[force:] force thumb creation, even if it already exists (default=0) (NOT RECOMENDED! – use it just for testing or debugging)
[crop:] if you want the thumbnail to be cropped (no image deformation) if the width and height are different from the original image, set this value as 1 or true. If you want the content of the thumbnail to be resized to fit the space (image deformation) set this to 0 or false (default=1).
[halign:] horizontal align of the croped image. You can set it to left, center or right (default=center)
[valign:] vertical align of the croped image. You can set it to top, center or bottom (default=center)
[effect:] you can apply two effects: grayscale and sephia
[rotate:] you can specify a rotation angle
[background:] hex color (like #ffffff) to apply on the background ONLY when you rotate the image. If you don’t want a color applied you can set this to transparent (default=transparent)
[return:] if set to 1 (or true) the image name will be returned instead of printed (default=0).
[preserveAnimation:] if set to 1 (or true) it will show animated gif’s with motion but without applying other parameters. Otherwise, it will show the first frame of the animated gif resized.