The IMAGE module regroups several image processing functions.
It offers the following functions
- image_resize
- image2stringpng
- image2stringgif
- image2stringjpg
- imagealphablending
- imagesavealpha
- imagefilter
thumb
This function allows to create a thumbnail from an image. JPEG and PNG format are allowed. The first parameter is the source file, the second one is the name of the file that will be created, the third one is the maximum width size and the last one is the maximum height size. No value is returned.Example :
~thumb('DSC0073.JPG','ico0073.png','100','100')
It is also possible through the use of additionnals variables to use convert (from the command-line tool ImageMagick) to do some more image processing.
In order to tell thumb to use convert instead of GD, one should set the variable "thumbuse" to "convert" :
~set('thumbuse', 'convert')
Then to make use of its full potential, it is necessary to specify what processing should be done through the variable convertopt :
~set('convertopt','-quality 65 +profile "*"')
In this example, convert will compress the image and will get rid of the informations (profiles...) that increase the file size and are not necessary for web use.
A full list of possible processings is available on ImageMagick website.
get_exif
This function retrieves the EXIF headers from the given JPEG. Headers returned depend on the image.Example :
~get_exif('DSC0073.JPG')
Download
FAQ