class.upload.php changelog

v 0.25 17/11/2007

- added translation files and mechanism to instantiate the class with a language different from English
- added forbidden to set an array of forbidden MIME types
- implemented support for simple wildcards in allowed and forbidden, such as image/*
- preset the file extension to the desired conversion format when converting an image
- added read and write support for BMP images
- added a flag file_is_image to determine if the file is a supported image type
- the class now provides some information about the image, before calling process(). Available are image_src_x, image_src_y and the newly introduced image_src_bits, image_src_pixels and image_src_type. Note that this will not work if open_basedir restrictions are in place
- improved logging; now provides useful system information
- added some more pre-processing checks for files that are images: image_max_width, image_max_height, image_max_pixels, image_max_ratio, image_min_width, image_min_height, image_min_pixels and image_min_ratio
- added image_ratio_pixels to resize an image to a number of pixels, keeping aspect ratio
- added image_is_palette and image_is_transparent and image_transparent_color for GIF images
- added image_default_color to define a fallback color for non alpha-transparent output formats, such as JPEG or BMP
- changed image_background_color, which now forces transparent areas to be painted
- improved reflections and color overlays so that it works with alpha transparent images
- image_reflection_color is now deprecated in favour of image_default_color
- transparent PNGs are now processed in true color, and fully preserving the alpha channel when doing merges
- transparent GIFs are now automatically detected. preserve_transparency is deprecated
- transparent true color images can be saved as GIF while retaining transparency, semi transparent areas being merged with image_default_color
- transparent true color images can be saved as JPG/BMP with the semi transparent areas being merged with image_default_color
- fixed conversion of images to true color
- the class can now output the uploaded files content as the return value of process() if the function is called with an empty or null argumenti, or no argument

v 0.24 25/05/2007

- added image_background_color, to set the default background color of an image
- added possibility of using replacement tokens in text labels
- changed default JPEG quality to 85
- fixed a small bug when using greyscale filter and associated filters
- added image_ratio_fill in order to fit an image within some dimensions and color the remaining space. Very similar to image_ratio_crop
- improved the recursive creation of directories
- the class now converts palette based images to true colors before doing graphic manipulations

v 0.23 23/12/2006

- fixed a bug when processing more than once the same uploaded file. If there is an open_basedir restriction, the class now creates a temporary file for the first call to process(). This file will be used for subsequent processes, and will be deleted upon calling clean()

v 0.22 16/12/2006

- added automatic creation of a temporary file if the upload directory is not within open_basedir
- fixed a bug which was preventing to work on a local file by overwriting it with its processed copy
- added MIME types video/x-ms-wmv and image/x-png and fixed PNG support for IE weird MIME types
- modified image_ratio_crop so it can accept one or more from string 'TBLR', determining which side of the image is kept while cropping
- added support for multiple lines in the text, using "\n" as a line break
- added image_text_line_spacing which allow to set the space between several lines of text
- added image_text_alignment which allow to set the alignment when text has several lines
- image_text_font can now be set to the path of a GDF font to load external fonts
- added image_reflection_height to create a reflection of the source image, which height is in pixels or percentage
- added image_reflection_space to set the space in pixels between the source image and the reflection
- added image_reflection_color to set the reflection background color
- added image_reflection_opacity to set the initial level of opacity of the reflection

v 0.21 30/09/2006

- added image_ratio_crop which resizes within image_x and image_y, keeping ratio, but filling the space by cropping excedent of image
- added mime_check, which default is true, to set checks against allowed MIME list
- if MIME is empty, the class now triggers an error
- color #000000 is OK for image_text_color, and related text transparency bug fixed
- gd_version() now uses gd_info(), or else phpinfo()
- fixed path issue when the destination path has no trailing slash on Windows systems
- removed inline functions to be fully PHP5 compatible

v 0.20 11/08/2006

- added some more error checking and messages (GD presence, permissions...).
- fix when uploading files without extension.
- changed values for image_brightness and image_contrast to be between -127 and 127.
- added dir_auto_create to automatically and recursively create destination directory if missing.
- added dir_auto_chmod to automatically chmod the destination directory if not writeable.
- added dir_chmod to set the default chmod to use.
- added image_crop to crop images.
- added image_negative to invert the colors on the image.
- added image_greyscale to turn the image into greyscale.
- added image_threshold to apply a threshold filter on the image.
- added image_bevel, image_bevel_color1 and image_bevel_color2 to add a bevel border.
- added image_border and image_border_color to add a single color border.
- added image_frame and image_frame_colors to add a multicolored frame.

v 0.19 29/03/2006

- class is now compatible i18n (thanks Sylwester).
- the class can mow manipulate local files, not only uploaded files (instanciate the class with a local filename).
- file_safe_name has been improved a bit.
- added image_brightness, image_contrast, image_tint_color, image_overlay_color and image_overlay_percent to do color manipulation on the images.
- added image_text and all derivated settings to add a text label on the image.
- added image_watermark and all derivated settings to add a watermark image on the image.
- added image_flip and image_rotate for more image manipulations
- added jpeg_size to calculate the JPG compression quality in order to fit within one filesize.

v 0.18 02/02/2006

- added no_script to turn dangerous scripts into text files.
- added mime_magic_check to set the class to use mime_magic.
- added preserve_transparency
- fixed size and mime checking, wasn't working :/ Thanks Willem.
- fixed memory leak when resizing images.
- when resizing, it is not necessary anymore to set image_convert.
- il is now possible to simply convert an image, with no resizing.
- sets the default file_max_size to upload_max_filesize from php.ini. Thanks Edward.

v 0.17 28/05/2005

- the class can be used with any version of GD.
- added security check on the file with a list of mime-types.
- changed the license to GPL v2 only

v 0.16 19/05/2005

- added file_auto_rename automatic file renaming if the same filename already exists.
- added file_safe_name safe formatting of the filename (spaces to _underscores so far).
- added some more error reporting to avoid crash if GD is not present

v 0.15 16/04/2005

- added JPEG compression quality setting. Thanks Vad

v 0.14 14/03/2005

- reworked the class file to allow parsing with phpDocumentor

v 0.13 07/03/2005

- fixed a bug with image_ratio. Thanks Justin.
- added image_ratio_no_zoom_in and image_ratio_no_zoom_out

v 0.12 21/01/2005

- added image_ratio to resize within max values, keeping image ratio

v 0.11 22/08/2003

- update for GD2 (changed imageresized() into imagecopyresampled() and imagecreate() into imagecreatetruecolor())