Class upload. More...
Public Member Functions | |
| init () | |
| Init or re-init all the processing variables to their default values. | |
| __construct ($file='', $lang='en_GB') | |
| Constructor, for PHP5+. | |
| upload ($file, $lang='en_GB') | |
| Constructor, for PHP4. | |
| gdversion ($full=false) | |
| Returns the version of GD. | |
| function_enabled ($func) | |
| Checks if a function is available. | |
| rmkdir ($path, $mode=0755) | |
| Creates directories recursively. | |
| _mkdir ($path, $mode=0755) | |
| Creates directory. | |
| translate ($str, $tokens=array()) | |
| Translate error messages. | |
| temp_dir () | |
| Returns the temp directory. | |
| sanitize ($filename) | |
| Sanitize a file name. | |
| getcolors ($color) | |
| Decodes colors. | |
| getsize ($size) | |
| Decodes sizes. | |
| getoffsets ($offsets, $x, $y, $round=true, $negative=true) | |
| Decodes offsets. | |
| imagecreatenew ($x, $y, $fill=true, $trsp=false) | |
| Creates a container image. | |
| imagetransfer ($src_im, $dst_im) | |
| Transfers an image from the container to the destination image. | |
| imageunset ($im) | |
| Destroy GD ressource. | |
| imagecopymergealpha (&$dst_im, &$src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct=0) | |
| Merges two GD images while preserving alpha information. | |
| process ($server_path=null) | |
| Actually uploads the file, and act on it according to the set processing class variables. | |
| clean () | |
| Deletes the uploaded file from its temporary location. | |
| imagecreatefrombmp ($filename) | |
| Opens a BMP image. | |
| imagebmp (&$im, $filename="") | |
| Saves a BMP image. | |
Public Attributes | |
| $version | |
| Class version. | |
| $file_src_name | |
| Uploaded file name. | |
| $file_src_name_body | |
| Uploaded file name body (i.e. | |
| $file_src_name_ext | |
| Uploaded file name extension. | |
| $file_src_mime | |
| Uploaded file MIME type. | |
| $file_src_size | |
| Uploaded file size, in bytes. | |
| $file_src_error | |
| Holds eventual PHP error code from $_FILES. | |
| $file_src_pathname | |
| Uloaded file name, including server path. | |
| $file_src_temp | |
| Uloaded file name temporary copy. | |
| $file_dst_path | |
| Destination file name. | |
| $file_dst_name | |
| Destination file name. | |
| $file_dst_name_body | |
| Destination file name body (i.e. | |
| $file_dst_name_ext | |
| Destination file extension. | |
| $file_dst_pathname | |
| Destination file name, including path. | |
| $image_src_x | |
| Source image width. | |
| $image_src_y | |
| Source image height. | |
| $image_src_bits | |
| Source image color depth. | |
| $image_src_pixels | |
| Number of pixels. | |
| $image_src_type | |
| Type of image (png, gif, jpg, webp or bmp). | |
| $image_dst_x | |
| Destination image width. | |
| $image_dst_y | |
| Destination image height. | |
| $image_dst_type | |
| Destination image type (png, gif, jpg, webp or bmp). | |
| $image_supported | |
| Supported image formats. | |
| $file_is_image | |
| Flag to determine if the source file is an image. | |
| $uploaded | |
| Flag set after instanciating the class. | |
| $no_upload_check | |
| Flag stopping PHP upload checks. | |
| $processed | |
| Flag set after calling a process. | |
| $error | |
| Holds eventual error message in plain english. | |
| $log | |
| Holds an HTML formatted log. | |
| $file_new_name_body | |
| Set this variable to replace the name body (i.e. | |
| $file_name_body_add | |
| Set this variable to append a string to the file name body. | |
| $file_name_body_pre | |
| Set this variable to prepend a string to the file name body. | |
| $file_new_name_ext | |
| Set this variable to change the file extension. | |
| $file_safe_name | |
| Set this variable to format the filename (spaces changed to _). | |
| $file_force_extension | |
| Forces an extension if the source file doesn't have one. | |
| $mime_check | |
| Set this variable to false if you don't want to check the MIME against the allowed list. | |
| $mime_fileinfo | |
| Set this variable to false in the init() function if you don't want to check the MIME with Fileinfo PECL extension. | |
| $mime_file | |
| Set this variable to false in the init() function if you don't want to check the MIME with UNIX file() command. | |
| $mime_magic | |
| Set this variable to false in the init() function if you don't want to check the MIME with the magic.mime file. | |
| $mime_getimagesize | |
| Set this variable to false in the init() function if you don't want to check the MIME with getimagesize(). | |
| $no_script | |
Set this variable to false if you don't want to turn dangerous scripts into simple text files The list of blacklisted extensions is in dangerous. | |
| $dangerous | |
| Dangerous file extensions. | |
| $file_auto_rename | |
| Set this variable to true to allow automatic renaming of the file if the file already exists. | |
| $dir_auto_create | |
| Set this variable to true to allow automatic creation of the destination directory if it is missing (works recursively). | |
| $dir_auto_chmod | |
| Set this variable to true to allow automatic chmod of the destination directory if it is not writeable. | |
| $dir_chmod | |
| Set this variable to the default chmod you want the class to use when creating directories, or attempting to write in a directory. | |
| $file_overwrite | |
| Set this variable tu true to allow overwriting of an existing file. | |
| $file_max_size | |
| Set this variable to change the maximum size in bytes for an uploaded file. | |
| $file_max_size_raw | |
| Max file size, from php.ini. | |
| $image_resize | |
| Set this variable to true to resize the file if it is an image. | |
| $image_convert | |
| Set this variable to convert the file if it is an image. | |
| $image_x | |
| Set this variable to the wanted (or maximum/minimum) width for the processed image, in pixels. | |
| $image_y | |
| Set this variable to the wanted (or maximum/minimum) height for the processed image, in pixels. | |
| $image_ratio | |
Set this variable to keep the original size ratio to fit within image_x x image_y. | |
| $image_ratio_crop | |
Set this variable to keep the original size ratio to fit within image_x x image_y. | |
| $image_ratio_fill | |
Set this variable to keep the original size ratio to fit within image_x x image_y. | |
| $image_ratio_pixels | |
Set this variable to a number of pixels so that image_x and image_y are the best match possible. | |
| $image_ratio_x | |
Set this variable to calculate image_x automatically , using image_y and conserving ratio. | |
| $image_ratio_y | |
Set this variable to calculate image_y automatically , using image_x and conserving ratio. | |
| $image_ratio_no_zoom_in | |
(deprecated) Set this variable to keep the original size ratio to fit within image_x x image_y, but only if original image is bigger | |
| $image_ratio_no_zoom_out | |
(deprecated) Set this variable to keep the original size ratio to fit within image_x x image_y, but only if original image is smaller | |
| $image_no_enlarging | |
| Cancel resizing if the resized image is bigger than the original image, to prevent enlarging. | |
| $image_no_shrinking | |
| Cancel resizing if the resized image is smaller than the original image, to prevent shrinking. | |
| $image_max_width | |
| Set this variable to set a maximum image width, above which the upload will be invalid. | |
| $image_max_height | |
| Set this variable to set a maximum image height, above which the upload will be invalid. | |
| $image_max_pixels | |
| Set this variable to set a maximum number of pixels for an image, above which the upload will be invalid. | |
| $image_max_ratio | |
| Set this variable to set a maximum image aspect ratio, above which the upload will be invalid. | |
| $image_min_width | |
| Set this variable to set a minimum image width, below which the upload will be invalid. | |
| $image_min_height | |
| Set this variable to set a minimum image height, below which the upload will be invalid. | |
| $image_min_pixels | |
| Set this variable to set a minimum number of pixels for an image, below which the upload will be invalid. | |
| $image_min_ratio | |
| Set this variable to set a minimum image aspect ratio, below which the upload will be invalid. | |
| $png_compression | |
| Compression level for PNG images. | |
| $jpeg_quality | |
| Quality of JPEG created/converted destination image. | |
| $webp_quality | |
| Quality of WebP created/converted destination image. | |
| $jpeg_size | |
| Determines the quality of the JPG image to fit a desired file size. | |
| $image_interlace | |
| Turns the interlace bit on. | |
| $image_is_transparent | |
| Flag set to true when the image is transparent. | |
| $image_transparent_color | |
| Transparent color in a palette. | |
| $image_background_color | |
| Background color, used to paint transparent areas with. | |
| $image_default_color | |
| Default color for non alpha-transparent images. | |
| $image_is_palette | |
| Flag set to true when the image is not true color. | |
| $image_brightness | |
| Corrects the image brightness. | |
| $image_contrast | |
| Corrects the image contrast. | |
| $image_opacity | |
| Changes the image opacity. | |
| $image_threshold | |
| Applies threshold filter. | |
| $image_tint_color | |
| Applies a tint on the image. | |
| $image_overlay_color | |
| Applies a colored overlay on the image. | |
| $image_overlay_opacity | |
| Sets the opacity for the colored overlay. | |
| $image_negative | |
| Inverts the color of an image. | |
| $image_greyscale | |
| Turns the image into greyscale. | |
| $image_pixelate | |
| Pixelate an image. | |
| $image_unsharp | |
| Applies an unsharp mask, with alpha transparency support. | |
| $image_unsharp_amount | |
| Sets the unsharp mask amount. | |
| $image_unsharp_radius | |
| Sets the unsharp mask radius. | |
| $image_unsharp_threshold | |
| Sets the unsharp mask threshold. | |
| $image_text | |
| Adds a text label on the image. | |
| $image_text_direction | |
| Sets the text direction for the text label. | |
| $image_text_color | |
| Sets the text color for the text label. | |
| $image_text_opacity | |
| Sets the text opacity in the text label. | |
| $image_text_background | |
| Sets the text background color for the text label. | |
| $image_text_background_opacity | |
| Sets the text background opacity in the text label. | |
| $image_text_font | |
| Sets the text font in the text label. | |
| $image_text_size | |
| Sets the text font size for TrueType fonts. | |
| $image_text_angle | |
| Sets the text angle for TrueType fonts. | |
| $image_text_position | |
| Sets the text label position within the image. | |
| $image_text_x | |
| Sets the text label absolute X position within the image. | |
| $image_text_y | |
| Sets the text label absolute Y position within the image. | |
| $image_text_padding | |
| Sets the text label padding. | |
| $image_text_padding_x | |
| Sets the text label horizontal padding. | |
| $image_text_padding_y | |
| Sets the text label vertical padding. | |
| $image_text_alignment | |
| Sets the text alignment. | |
| $image_text_line_spacing | |
| Sets the text line spacing. | |
| $image_reflection_height | |
| Sets the height of the reflection. | |
| $image_reflection_space | |
| Sets the space between the source image and its relection. | |
| $image_reflection_opacity | |
| Sets the initial opacity of the reflection. | |
| $image_auto_rotate | |
| Automatically rotates the image according to EXIF data (JPEG only). | |
| $image_flip | |
| Flips the image vertically or horizontally. | |
| $image_rotate | |
| Rotates the image by increments of 45 degrees. | |
| $image_crop | |
| Crops an image. | |
| $image_precrop | |
| Crops an image, before an eventual resizing. | |
| $image_bevel | |
| Adds a bevel border on the image. | |
| $image_bevel_color1 | |
| Top and left bevel color. | |
| $image_bevel_color2 | |
| Right and bottom bevel color. | |
| $image_border | |
| Adds a single-color border on the outer of the image. | |
| $image_border_color | |
| Border color. | |
| $image_border_opacity | |
| Sets the opacity for the borders. | |
| $image_border_transparent | |
| Adds a fading-to-transparent border on the image. | |
| $image_frame | |
| Adds a multi-color frame on the outer of the image. | |
| $image_frame_colors | |
| Sets the colors used to draw a frame. | |
| $image_frame_opacity | |
| Sets the opacity for the frame. | |
| $image_watermark | |
| Adds a watermark on the image. | |
| $image_watermark_position | |
| Sets the watermarkposition within the image. | |
| $image_watermark_x | |
| Sets the watermark absolute X position within the image. | |
| $image_watermark_y | |
| Sets the twatermark absolute Y position within the image. | |
| $image_watermark_no_zoom_in | |
| Prevents the watermark to be resized up if it is smaller than the image. | |
| $image_watermark_no_zoom_out | |
| Prevents the watermark to be resized down if it is bigger than the image. | |
| $mime_types | |
| List of MIME types per extension. | |
| $allowed | |
| Allowed MIME types or file extensions. | |
| $forbidden | |
| Forbidden MIME types or file extensions. | |
| $translation | |
| Array of translated error messages. | |
| $lang | |
| Language selected for the translations. | |
| dbxUpload::__construct | ( | $file = '', | |
| $lang = 'en_GB' ) |
Constructor, for PHP5+.
Definition at line 2037 of file dbxUpload.class.php.
| dbxUpload::_mkdir | ( | $path, | |
| $mode = 0755 ) |
Creates directory.
@access private
| string | $path | Path to create |
| integer | $mode | Optional permissions |
Definition at line 2704 of file dbxUpload.class.php.
References $mode.
Referenced by rmkdir().
| dbxUpload::clean | ( | ) |
Deletes the uploaded file from its temporary location.
When PHP uploads a file, it stores it in a temporary location. When you process the file, you actually copy the resulting file to the given location, it doesn't alter the original file. Once you have processed the file as many times as you wanted, you can delete the uploaded file. If there is open_basedir restrictions, the uploaded file is in fact a temporary file
You might want not to use this function if you work on local files, as it will delete the source file
@access public
Definition at line 5065 of file dbxUpload.class.php.
| dbxUpload::function_enabled | ( | $func | ) |
Checks if a function is available.
@access private
| string | $func | Function name |
Definition at line 2673 of file dbxUpload.class.php.
References $disabled.
Referenced by gdversion(), process(), temp_dir(), and upload().
| dbxUpload::gdversion | ( | $full = false | ) |
Returns the version of GD.
@access public
| boolean | $full | Optional flag to get precise version |
Definition at line 2636 of file dbxUpload.class.php.
References function_enabled().
Referenced by imagecreatenew(), process(), and upload().
| dbxUpload::getcolors | ( | $color | ) |
Decodes colors.
@access private
| string | $color | Color string |
Definition at line 2797 of file dbxUpload.class.php.
Referenced by imagecreatenew(), and process().
| dbxUpload::getoffsets | ( | $offsets, | |
| $x, | |||
| $y, | |||
| $round = true, | |||
| $negative = true ) |
Decodes offsets.
@access private
| misc | $offsets | Offsets, as an integer, a string or an array |
| integer | $x | Reference picture width |
| integer | $y | Reference picture height |
| boolean | $round | Round offsets before returning them |
| boolean | $negative | Allow negative offsets to be returned |
Definition at line 2840 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::getsize | ( | $size | ) |
Decodes sizes.
@access private
| string | $size | Size in bytes, or shorthand byte options |
Definition at line 2814 of file dbxUpload.class.php.
| dbxUpload::imagebmp | ( | & | $im, |
| $filename = "" ) |
Saves a BMP image.
This function has been published on the PHP website, and can be used freely
@access public
Definition at line 5154 of file dbxUpload.class.php.
References $file, $result, $tmp, and imageunset().
Referenced by process().
| dbxUpload::imagecopymergealpha | ( | & | $dst_im, |
| & | $src_im, | ||
| $dst_x, | |||
| $dst_y, | |||
| $src_x, | |||
| $src_y, | |||
| $src_w, | |||
| $src_h, | |||
| $pct = 0 ) |
Merges two GD images while preserving alpha information.
PNG and WEBP overlays are merged pixel by pixel so transparent areas stay transparent. The destination image is modified by reference and also returned for fluent internal use.
Example:
Result: $watermark is blended into $dst at position 20/20 with 60 percent opacity.
@access private
| resource | \GdImage | $dst_im | Destination image, modified in place. |
| resource | \GdImage | $src_im | Source/overlay image. |
| int | $dst_x | X-coordinate in the destination image. |
| int | $dst_y | Y-coordinate in the destination image. |
| int | $src_x | X-coordinate in the source image. |
| int | $src_y | Y-coordinate in the source image. |
| int | $src_w | Width of the source area. |
| int | $src_h | Height of the source area. |
| int | $pct | Overlay opacity from 0 to 100. |
Definition at line 2969 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::imagecreatefrombmp | ( | $filename | ) |
Opens a BMP image.
This function has been written by DHKold, and is used with permission of the author
@access public
Definition at line 5079 of file dbxUpload.class.php.
References $file.
Referenced by process().
| dbxUpload::imagecreatenew | ( | $x, | |
| $y, | |||
| $fill = true, | |||
| $trsp = false ) |
Creates a container image.
@access private
| integer | $x | Width |
| integer | $y | Height |
| boolean | $fill | Optional flag to draw the background color or not |
| boolean | $trsp | Optional flag to set the background to be transparent |
Definition at line 2883 of file dbxUpload.class.php.
References gdversion(), and getcolors().
Referenced by process().
| dbxUpload::imagetransfer | ( | $src_im, | |
| $dst_im ) |
Transfers an image from the container to the destination image.
@access private
| resource | $src_im | Container image |
| resource | $dst_im | Destination image |
Definition at line 2921 of file dbxUpload.class.php.
References imageunset().
Referenced by process().
| dbxUpload::imageunset | ( | $im | ) |
Destroy GD ressource.
@access private
| resource | $im | Image |
Definition at line 2933 of file dbxUpload.class.php.
Referenced by imagebmp(), imagetransfer(), and process().
| dbxUpload::init | ( | ) |
| dbxUpload::process | ( | $server_path = null | ) |
Actually uploads the file, and act on it according to the set processing class variables.
This function copies the uploaded file to the given location, eventually performing actions on it. Typically, you can call process several times for the same file, for instance to create a resized image and a thumbnail of the same file. The original uploaded file remains intact in its temporary location, so you can use process several times. You will be able to delete the uploaded file with clean when you have finished all your process calls.
According to the processing class variables set in the calling file, the file can be renamed, and if it is an image, can be resized or converted.
When the processing is completed, and the file copied to its new location, the processing class variables will be reset to their default value. This allows you to set new properties, and perform another process on the same uploaded file
If the function is called with a null or empty argument, then it will return the content of the picture
It will set processed (and error is an error occurred)
@access public
| string | $server_path | Optional path location of the uploaded file, with an ending slash |
Definition at line 3045 of file dbxUpload.class.php.
References $_SERVER, $allowed, $body, $file_dst_name, $file_dst_name_body, $file_max_size, $file_name_body_add, $file_new_name_body, $file_new_name_ext, $file_src_name, $file_src_name_body, $file_src_name_ext, $file_src_pathname, $file_src_temp, $filter, $image_background_color, $image_bevel, $image_convert, $image_default_color, $image_dst_x, $image_dst_y, $image_frame_colors, $image_reflection_height, $image_reflection_opacity, $image_reflection_space, $image_src_type, $image_src_x, $image_src_y, $image_text, $image_text_font, $image_text_padding, $image_text_padding_x, $image_text_padding_y, $image_text_x, $image_text_y, $image_unsharp_radius, $image_unsharp_threshold, $image_watermark_x, $image_watermark_y, $image_x, $image_y, $it, $result, $tmp, function_enabled(), gdversion(), getcolors(), getoffsets(), getsize(), imagebmp(), imagecopymergealpha(), imagecreatefrombmp(), imagecreatenew(), imagetransfer(), imageunset(), init(), rmkdir(), sanitize(), and translate().
| dbxUpload::rmkdir | ( | $path, | |
| $mode = 0755 ) |
| dbxUpload::sanitize | ( | $filename | ) |
Sanitize a file name.
@access private
| string | $filename | File name |
Definition at line 2757 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::temp_dir | ( | ) |
Returns the temp directory.
@access private
Definition at line 2731 of file dbxUpload.class.php.
References $dir, $tmp, and function_enabled().
Referenced by upload().
| dbxUpload::translate | ( | $str, | |
| $tokens = array() ) |
Translate error messages.
@access private
| string | $str | Message to translate |
| array | $tokens | Optional token values |
Definition at line 2719 of file dbxUpload.class.php.
| dbxUpload::upload | ( | $file, | |
| $lang = 'en_GB' ) |
Constructor, for PHP4.
Checks if the file has been uploaded
The constructor takes $_FILES['form_field'] array as argument where form_field is the form field name
The constructor will check if the file has been uploaded in its temporary location, and accordingly will set uploaded (and error is an error occurred)
If the file has been uploaded, the constructor will populate all the variables holding the upload information (none of the processing class variables are used here). You can have access to information about the file (name, size, MIME type...).
Alternatively, you can set the first argument to be a local filename (string) This allows processing of a local file, as if the file was uploaded
The optional second argument allows you to set the language for the error messages
@access private
| array | $file | $_FILES['form_field'] or string $file Local filename |
| string | $lang | Optional language code |
Definition at line 2065 of file dbxUpload.class.php.
References $_SERVER, $file, $file_src_mime, $file_src_name, $file_src_name_ext, $image_src_x, $image_src_y, $lang, $mime_fileinfo, $translation, function_enabled(), gdversion(), init(), temp_dir(), and translate().
Referenced by __construct().
| dbxUpload::$allowed |
Allowed MIME types or file extensions.
Default is a selection of safe mime-types, but you might want to change it
Simple wildcards are allowed for MIME types, for example image all or application all If there is only one MIME type allowed or file extension, then it can be a string instead of an array
@access public Typ: $type.
Definition at line 1646 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$dangerous |
Dangerous file extensions.
List of dangerous extensions, that are enforced if no_script is true If the file has such extension, then it is turned into a text file
@access public Typ: $type.
Definition at line 401 of file dbxUpload.class.php.
| dbxUpload::$dir_auto_chmod |
Set this variable to true to allow automatic chmod of the destination directory if it is not writeable.
Default value is true
@access public Typ: $type.
Definition at line 437 of file dbxUpload.class.php.
| dbxUpload::$dir_auto_create |
Set this variable to true to allow automatic creation of the destination directory if it is missing (works recursively).
Default value is true
@access public Typ: $type.
Definition at line 427 of file dbxUpload.class.php.
| dbxUpload::$dir_chmod |
Set this variable to the default chmod you want the class to use when creating directories, or attempting to write in a directory.
Default value is 0755 (without quotes)
@access public Typ: $type.
Definition at line 447 of file dbxUpload.class.php.
| dbxUpload::$error |
Holds eventual error message in plain english.
@access public Typ: $type.
Definition at line 254 of file dbxUpload.class.php.
| dbxUpload::$file_auto_rename |
Set this variable to true to allow automatic renaming of the file if the file already exists.
Default value is true
For instance, on uploading foo.ext,
if foo.ext already exists, upload will be renamed foo_1.ext
and if foo_1.ext already exists, upload will be renamed foo_2.ext
Note that this option doesn't have any effect if file_overwrite is true
@access public Typ: $type.
Definition at line 417 of file dbxUpload.class.php.
| dbxUpload::$file_dst_name |
Destination file name.
@access public Typ: $type.
Definition at line 117 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$file_dst_name_body |
Destination file name body (i.e.
without extension)
@access public Typ: $type.
Definition at line 124 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$file_dst_name_ext |
Destination file extension.
@access public Typ: $type.
Definition at line 131 of file dbxUpload.class.php.
| dbxUpload::$file_dst_path |
Destination file name.
@access public Typ: $type.
Definition at line 110 of file dbxUpload.class.php.
| dbxUpload::$file_dst_pathname |
Destination file name, including path.
@access public Typ: $type.
Definition at line 138 of file dbxUpload.class.php.
| dbxUpload::$file_force_extension |
Forces an extension if the source file doesn't have one.
If the file is an image, then the correct extension will be added Otherwise, a .txt extension will be chosen
@access public Typ: $type.
Definition at line 312 of file dbxUpload.class.php.
| dbxUpload::$file_is_image |
Flag to determine if the source file is an image.
@access public Typ: $type.
Definition at line 215 of file dbxUpload.class.php.
| dbxUpload::$file_max_size |
Set this variable to change the maximum size in bytes for an uploaded file.
Default value is the value upload_max_filesize from php.ini
Value in bytes (integer) or shorthand byte values (string) is allowed. The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes)
@access public Typ: $type.
Definition at line 468 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$file_max_size_raw |
Max file size, from php.ini.
@access private Typ: $type.
Definition at line 475 of file dbxUpload.class.php.
| dbxUpload::$file_name_body_add |
Set this variable to append a string to the file name body.
@access public Typ: $type.
Definition at line 279 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$file_name_body_pre |
Set this variable to prepend a string to the file name body.
@access public Typ: $type.
Definition at line 286 of file dbxUpload.class.php.
| dbxUpload::$file_new_name_body |
Set this variable to replace the name body (i.e.
without extension)
@access public Typ: $type.
Definition at line 272 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$file_new_name_ext |
Set this variable to change the file extension.
@access public Typ: $type.
Definition at line 293 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$file_overwrite |
Set this variable tu true to allow overwriting of an existing file.
Default value is false, so no files will be overwritten
@access public Typ: $type.
Definition at line 456 of file dbxUpload.class.php.
| dbxUpload::$file_safe_name |
Set this variable to format the filename (spaces changed to _).
@access public Typ: $type.
Definition at line 301 of file dbxUpload.class.php.
| dbxUpload::$file_src_error |
Holds eventual PHP error code from $_FILES.
@access public Typ: $type.
Definition at line 89 of file dbxUpload.class.php.
| dbxUpload::$file_src_mime |
Uploaded file MIME type.
@access public Typ: $type.
Definition at line 75 of file dbxUpload.class.php.
Referenced by upload().
| dbxUpload::$file_src_name |
| dbxUpload::$file_src_name_body |
Uploaded file name body (i.e.
without extension)
@access public Typ: $type.
Definition at line 61 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$file_src_name_ext |
Uploaded file name extension.
@access public Typ: $type.
Definition at line 68 of file dbxUpload.class.php.
| dbxUpload::$file_src_pathname |
Uloaded file name, including server path.
@access public Typ: $type.
Definition at line 96 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$file_src_size |
Uploaded file size, in bytes.
@access public Typ: $type.
Definition at line 82 of file dbxUpload.class.php.
| dbxUpload::$file_src_temp |
Uloaded file name temporary copy.
@access private Typ: $type.
Definition at line 103 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$forbidden |
Forbidden MIME types or file extensions.
Default is a selection of forbidden file extensions, but you might want to change it To only check for forbidden MIME types, and allow everything else, set allowed to an array containing the all-types wildcard
Note that if no_script is activated, dangerous scripts with extensions in dangerous will be set to have a .txt extension prior to checking for forbidden extensions If you want to forbid uploads rather than turning scripts into text files, set no_script to false
Simple wildcards are allowed for MIME types, for example image all or application all If there is only one MIME type or file extension forbidden, then it can be a string instead of an array
@access public Typ: $type.
Definition at line 1663 of file dbxUpload.class.php.
| dbxUpload::$image_auto_rotate |
Automatically rotates the image according to EXIF data (JPEG only).
Default value is true
@access public Typ: $type. ean;
Definition at line 1306 of file dbxUpload.class.php.
| dbxUpload::$image_background_color |
Background color, used to paint transparent areas with.
If set, it will forcibly remove transparency by painting transparent areas with the color This setting will fill in all transparent areas in PNG, WEPB and GIF, as opposed to image_default_color which will do so only in BMP, JPEG, and alpha transparent areas in transparent GIFs This setting overrides image_default_color
Default value is null
@access public Typ: $type.
Definition at line 802 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_bevel |
Adds a bevel border on the image.
Value is a positive integer, representing the thickness of the bevel
If the bevel colors are the same as the background, it makes a fade out effect
Default value is null (no bevel)
@access public Typ: $type.
Definition at line 1386 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_bevel_color1 |
Top and left bevel color.
Value is a color, in hexadecimal format This setting is used only if image_bevel is set
Default value is #FFFFFF
@access public Typ: $type. ;
Definition at line 1399 of file dbxUpload.class.php.
| dbxUpload::$image_bevel_color2 |
Right and bottom bevel color.
Value is a color, in hexadecimal format This setting is used only if image_bevel is set
Default value is #000000
@access public Typ: $type. ;
Definition at line 1412 of file dbxUpload.class.php.
| dbxUpload::$image_border |
Adds a single-color border on the outer of the image.
Values are four dimensions, or two, or one (CSS style) They represent the border thickness top, right, bottom and left. These values can either be in an array, or a space separated string. Each value can be in pixels (with or without 'px'), or percentage (of the source image)
See image_crop for valid formats
If a value is negative, the image will be cropped. Note that the dimensions of the picture will be increased by the borders' thickness
Default value is null (no border)
@access public Typ: $type.
Definition at line 1432 of file dbxUpload.class.php.
| dbxUpload::$image_border_color |
Border color.
Value is a color, in hexadecimal format. This setting is used only if image_border is set
Default value is #FFFFFF
@access public Typ: $type. ;
Definition at line 1445 of file dbxUpload.class.php.
| dbxUpload::$image_border_opacity |
Sets the opacity for the borders.
Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
Unless used with image_border, this setting has no effect
Default value is 100
@access public Typ: $type.
Definition at line 1459 of file dbxUpload.class.php.
| dbxUpload::$image_border_transparent |
Adds a fading-to-transparent border on the image.
Values are four dimensions, or two, or one (CSS style) They represent the border thickness top, right, bottom and left. These values can either be in an array, or a space separated string. Each value can be in pixels (with or without 'px'), or percentage (of the source image)
See image_crop for valid formats
Note that the dimensions of the picture will not be increased by the borders' thickness
Default value is null (no border)
@access public Typ: $type.
Definition at line 1478 of file dbxUpload.class.php.
| dbxUpload::$image_brightness |
Corrects the image brightness.
Value can range between -127 and 127
Default value is null
@access public Typ: $type.
Definition at line 838 of file dbxUpload.class.php.
| dbxUpload::$image_contrast |
Corrects the image contrast.
Value can range between -127 and 127
Default value is null
@access public Typ: $type.
Definition at line 850 of file dbxUpload.class.php.
| dbxUpload::$image_convert |
Set this variable to convert the file if it is an image.
Possibles values are : ''; 'png'; 'jpeg'; 'gif'; 'webp'; 'bmp'
Default value is '' (no conversion)
If resize is true, convert will be set to the source file extension
@access public Typ: $type.
Definition at line 498 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_crop |
Crops an image.
Values are four dimensions, or two, or one (CSS style) They represent the amount cropped top, right, bottom and left. These values can either be in an array, or a space separated string. Each value can be in pixels (with or without 'px'), or percentage (of the source image)
For instance, are valid:
$foo->image_crop = 20 OR array(20);
$foo->image_crop = '20px' OR array('20px');
$foo->image_crop = '20 40' OR array('20', 40);
$foo->image_crop = '-20 25' OR array(-20, '25');
$foo->image_crop = '20px 25' OR array('20px', '25');
$foo->image_crop = '20% 25' OR array('20', '25');
$foo->image_crop = '20% 25% 10% 30' OR array('20', '25', '10', '30');
$foo->image_crop = '20px 25px 2px 2px' OR array('20px', '25px', '2px', '2px');
$foo->image_crop = '20 25% 40px 10' OR array(20, '25', '40px', '10');
If a value is negative, the image will be expanded, and the extra parts will be filled with black
Default value is null (no cropping)
@access public Typ: $type. ;
Definition at line 1360 of file dbxUpload.class.php.
| dbxUpload::$image_default_color |
Default color for non alpha-transparent images.
This setting is to be used to define a background color for semi transparent areas of an alpha transparent when the output format doesn't support alpha transparency This is useful when, from an alpha transparent PNG or WEBP image, or an image with alpha transparent features if you want to output it as a transparent GIFs for instance, you can set a blending color for transparent areas If you output in JPEG or BMP, this color will be used to fill in the previously transparent areas
The default color white
@access public Typ: $type.
Definition at line 818 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_dst_type |
Destination image type (png, gif, jpg, webp or bmp).
@access public Typ: $type.
Definition at line 200 of file dbxUpload.class.php.
| dbxUpload::$image_dst_x |
Destination image width.
@access public Typ: $type.
Definition at line 184 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_dst_y |
Destination image height.
@access public Typ: $type.
Definition at line 192 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_flip |
Flips the image vertically or horizontally.
Value is either 'h' or 'v', as in horizontal and vertical
Default value is null (no flip)
@access public Typ: $type. ;
Definition at line 1318 of file dbxUpload.class.php.
| dbxUpload::$image_frame |
Adds a multi-color frame on the outer of the image.
Value is an integer. Two values are possible for now: 1 for flat border, meaning that the frame is mirrored horizontally and vertically 2 for crossed border, meaning that the frame will be inversed, as in a bevel effect
The frame will be composed of colored lines set in image_frame_colors
Note that the dimensions of the picture will be increased by the borders' thickness
Default value is null (no frame)
@access public Typ: $type.
Definition at line 1496 of file dbxUpload.class.php.
| dbxUpload::$image_frame_colors |
Sets the colors used to draw a frame.
Values is a list of n colors in hexadecimal format. These values can either be in an array, or a space separated string.
The colors are listed in the following order: from the outset of the image to its center
For instance, are valid:
$foo->image_frame_colors = '#FFFFFF #999999 #666666 #000000';
$foo->image_frame_colors = array('#FFFFFF', '#999999', '#666666', '#000000');
This setting is used only if image_frame is set
Default value is '#FFFFFF #999999 #666666 #000000'
@access public Typ: $type. ;
Definition at line 1519 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_frame_opacity |
Sets the opacity for the frame.
Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
Unless used with image_frame, this setting has no effect
Default value is 100
@access public Typ: $type.
Definition at line 1533 of file dbxUpload.class.php.
| dbxUpload::$image_greyscale |
Turns the image into greyscale.
Default value is FALSE
@access public Typ: $type. ean;
Definition at line 934 of file dbxUpload.class.php.
| dbxUpload::$image_interlace |
Turns the interlace bit on.
This is actually used only for JPEG images, and defaults to false
@access public Typ: $type.
Definition at line 768 of file dbxUpload.class.php.
| dbxUpload::$image_is_palette |
Flag set to true when the image is not true color.
@access public Typ: $type.
Definition at line 826 of file dbxUpload.class.php.
| dbxUpload::$image_is_transparent |
Flag set to true when the image is transparent.
This is actually used only for transparent GIFs
@access public Typ: $type.
Definition at line 778 of file dbxUpload.class.php.
| dbxUpload::$image_max_height |
Set this variable to set a maximum image height, above which the upload will be invalid.
Default value is null
@access public Typ: $type.
Definition at line 650 of file dbxUpload.class.php.
| dbxUpload::$image_max_pixels |
Set this variable to set a maximum number of pixels for an image, above which the upload will be invalid.
Default value is null
@access public Typ: $type.
Definition at line 659 of file dbxUpload.class.php.
| dbxUpload::$image_max_ratio |
Set this variable to set a maximum image aspect ratio, above which the upload will be invalid.
Note that ratio = width / height
Default value is null
@access public Typ: $type.
Definition at line 670 of file dbxUpload.class.php.
| dbxUpload::$image_max_width |
Set this variable to set a maximum image width, above which the upload will be invalid.
Default value is null
@access public Typ: $type.
Definition at line 640 of file dbxUpload.class.php.
| dbxUpload::$image_min_height |
Set this variable to set a minimum image height, below which the upload will be invalid.
Default value is null
@access public Typ: $type.
Definition at line 690 of file dbxUpload.class.php.
| dbxUpload::$image_min_pixels |
Set this variable to set a minimum number of pixels for an image, below which the upload will be invalid.
Default value is null
@access public Typ: $type.
Definition at line 699 of file dbxUpload.class.php.
| dbxUpload::$image_min_ratio |
Set this variable to set a minimum image aspect ratio, below which the upload will be invalid.
Note that ratio = width / height
Default value is null
@access public Typ: $type.
Definition at line 710 of file dbxUpload.class.php.
| dbxUpload::$image_min_width |
Set this variable to set a minimum image width, below which the upload will be invalid.
Default value is null
@access public Typ: $type.
Definition at line 680 of file dbxUpload.class.php.
| dbxUpload::$image_negative |
Inverts the color of an image.
Default value is FALSE
@access public Typ: $type. ean;
Definition at line 924 of file dbxUpload.class.php.
| dbxUpload::$image_no_enlarging |
Cancel resizing if the resized image is bigger than the original image, to prevent enlarging.
Default value is false
@access public Typ: $type.
Definition at line 621 of file dbxUpload.class.php.
| dbxUpload::$image_no_shrinking |
Cancel resizing if the resized image is smaller than the original image, to prevent shrinking.
Default value is false
@access public Typ: $type.
Definition at line 630 of file dbxUpload.class.php.
| dbxUpload::$image_opacity |
Changes the image opacity.
Value can range between 0 and 100
Default value is null
@access public Typ: $type.
Definition at line 862 of file dbxUpload.class.php.
| dbxUpload::$image_overlay_color |
Applies a colored overlay on the image.
Value is an hexadecimal color, such as #FFFFFF
To use with image_overlay_opacity
Default value is null
@access public Typ: $type. ;
Definition at line 900 of file dbxUpload.class.php.
| dbxUpload::$image_overlay_opacity |
Sets the opacity for the colored overlay.
Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
Unless used with image_overlay_color, this setting has no effect
Default value is 50
@access public Typ: $type.
Definition at line 914 of file dbxUpload.class.php.
| dbxUpload::$image_pixelate |
Pixelate an image.
Value is integer, represents the block size
Default value is null
@access public Typ: $type. eger;
Definition at line 946 of file dbxUpload.class.php.
| dbxUpload::$image_precrop |
Crops an image, before an eventual resizing.
See image_crop for valid formats
Default value is null (no cropping)
@access public Typ: $type. ;
Definition at line 1372 of file dbxUpload.class.php.
| dbxUpload::$image_ratio |
Set this variable to keep the original size ratio to fit within image_x x image_y.
Default value is false
@access public Typ: $type.
Definition at line 527 of file dbxUpload.class.php.
| dbxUpload::$image_ratio_crop |
Set this variable to keep the original size ratio to fit within image_x x image_y.
The image will be resized as to fill the whole space, and excedent will be cropped
Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right) If set as a string, it determines which side of the image is kept while cropping. By default, the part of the image kept is in the center, i.e. it crops equally on both sides
Default value is false
@access public Typ: $type.
Definition at line 542 of file dbxUpload.class.php.
| dbxUpload::$image_ratio_fill |
Set this variable to keep the original size ratio to fit within image_x x image_y.
The image will be resized to fit entirely in the space, and the rest will be colored. The default color is white, but can be set with image_default_color
Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right) If set as a string, it determines in which side of the space the image is displayed. By default, the image is displayed in the center, i.e. it fills the remaining space equally on both sides
Default value is false
@access public Typ: $type.
Definition at line 558 of file dbxUpload.class.php.
| dbxUpload::$image_ratio_no_zoom_in |
(deprecated) Set this variable to keep the original size ratio to fit within image_x x image_y, but only if original image is bigger
This setting is soon to be deprecated. Instead, use image_ratio and image_no_enlarging
Default value is false
@access public Typ: $type.
Definition at line 600 of file dbxUpload.class.php.
| dbxUpload::$image_ratio_no_zoom_out |
(deprecated) Set this variable to keep the original size ratio to fit within image_x x image_y, but only if original image is smaller
Default value is false
This setting is soon to be deprecated. Instead, use image_ratio and image_no_shrinking
@access public Typ: $type.
Definition at line 612 of file dbxUpload.class.php.
| dbxUpload::$image_ratio_pixels |
Set this variable to a number of pixels so that image_x and image_y are the best match possible.
The image will be resized to have approximatively the number of pixels The aspect ratio wil be conserved
Default value is false
@access public Typ: $type.
Definition at line 570 of file dbxUpload.class.php.
| dbxUpload::$image_ratio_x |
Set this variable to calculate image_x automatically , using image_y and conserving ratio.
Default value is false
@access public Typ: $type.
Definition at line 579 of file dbxUpload.class.php.
| dbxUpload::$image_ratio_y |
Set this variable to calculate image_y automatically , using image_x and conserving ratio.
Default value is false
@access public Typ: $type.
Definition at line 588 of file dbxUpload.class.php.
| dbxUpload::$image_reflection_height |
Sets the height of the reflection.
Value is an integer in pixels, or a string which format can be in pixels or percentage. For instance, values can be : 40, '40', '40px' or '40'
Default value is null, no reflection
@access public Typ: $type. ;
Definition at line 1267 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_reflection_opacity |
Sets the initial opacity of the reflection.
Value is an integer between 0 (no opacity) and 100 (full opacity). The reflection will start from image_reflection_opacity and end up at 0
Default value is 60
This setting is relevant only if image_reflection_height is set
@access public Typ: $type.
Definition at line 1296 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_reflection_space |
Sets the space between the source image and its relection.
Value is an integer in pixels, which can be negative
Default value is 2
This setting is relevant only if image_reflection_height is set
@access public Typ: $type.
Definition at line 1281 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_resize |
Set this variable to true to resize the file if it is an image.
You will probably want to set image_x and image_y, and maybe one of the ratio variables
Default value is false (no resizing)
@access public Typ: $type.
Definition at line 486 of file dbxUpload.class.php.
| dbxUpload::$image_rotate |
Rotates the image by increments of 45 degrees.
Value is either 90, 180 or 270
Default value is null (no rotation)
@access public Typ: $type. ;
Definition at line 1330 of file dbxUpload.class.php.
| dbxUpload::$image_src_bits |
Source image color depth.
@access public Typ: $type.
Definition at line 162 of file dbxUpload.class.php.
| dbxUpload::$image_src_pixels |
| dbxUpload::$image_src_type |
Type of image (png, gif, jpg, webp or bmp).
@access public Typ: $type.
Definition at line 176 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_src_x |
| dbxUpload::$image_src_y |
| dbxUpload::$image_supported |
Supported image formats.
@access private Typ: $type.
Definition at line 207 of file dbxUpload.class.php.
| dbxUpload::$image_text |
Adds a text label on the image.
Value is a string, any text. Text will not word-wrap, although you can use breaklines in your text "\n"
If set, this setting allow the use of all other settings starting with image_text_
Replacement tokens can be used in the string:
gd_version src_name src_name_body src_name_ext src_pathname src_mime src_x src_y src_type src_bits src_pixels src_size src_size_kb src_size_mb src_size_human dst_path dst_name_body dst_pathname dst_name dst_name_ext dst_x dst_y date time host server ip
The tokens must be enclosed in square brackets: [dst_x] will be replaced by the width of the picture
Default value is null
@access public Typ: $type. ;
Definition at line 1029 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_text_alignment |
Sets the text alignment.
Value is a string, which can be either 'L', 'C' or 'R'
Default value is 'C'
This setting is relevant only if the text has several lines.
Note that this setting is only applicable to GD fonts, and has no effects with TrueType fonts
@access public Typ: $type. ;
Definition at line 1238 of file dbxUpload.class.php.
| dbxUpload::$image_text_angle |
Sets the text angle for TrueType fonts.
Value is a an integer between 0 and 360, in degrees, with 0 degrees being left-to-right reading text.
Note that this setting is only applicable to TrueType fonts, and has no effects with GD fonts For GD fonts, you can use image_text_direction instead
Default value is null (so it is determined by the value of image_text_direction)
@access public Typ: $type. eger;
Definition at line 1133 of file dbxUpload.class.php.
| dbxUpload::$image_text_background |
Sets the text background color for the text label.
Value is an hexadecimal color, such as #FFFFFF
Default value is null (no background)
@access public Typ: $type. ;
Definition at line 1079 of file dbxUpload.class.php.
| dbxUpload::$image_text_background_opacity |
Sets the text background opacity in the text label.
Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
Default value is 100
@access public Typ: $type.
Definition at line 1091 of file dbxUpload.class.php.
| dbxUpload::$image_text_color |
Sets the text color for the text label.
Value is an hexadecimal color, such as #FFFFFF
Default value is #FFFFFF (white)
@access public Typ: $type. ;
Definition at line 1055 of file dbxUpload.class.php.
| dbxUpload::$image_text_direction |
Sets the text direction for the text label.
Value is either 'h' or 'v', as in horizontal and vertical
Note that if you use a TrueType font, you can use image_text_angle instead
Default value is h (horizontal)
@access public Typ: $type. ;
Definition at line 1043 of file dbxUpload.class.php.
| dbxUpload::$image_text_font |
Sets the text font in the text label.
Value is a an integer between 1 and 5 for GD built-in fonts. 1 is the smallest font, 5 the biggest Value can also be a string, which represents the path to a GDF or TTF font (TrueType).
Default value is 5
@access public Typ: $type. ;
Definition at line 1104 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_text_line_spacing |
Sets the text line spacing.
Value is an integer, in pixels
Default value is 0
This setting is relevant only if the text has several lines.
Note that this setting is only applicable to GD fonts, and has no effects with TrueType fonts
@access public Typ: $type.
Definition at line 1254 of file dbxUpload.class.php.
| dbxUpload::$image_text_opacity |
Sets the text opacity in the text label.
Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
Default value is 100
@access public Typ: $type.
Definition at line 1067 of file dbxUpload.class.php.
| dbxUpload::$image_text_padding |
Sets the text label padding.
Value is in pixels, representing the distance between the text and the label background border
Default value is 0
This setting can be overriden by image_text_padding_x and image_text_padding_y
@access public Typ: $type.
Definition at line 1194 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_text_padding_x |
Sets the text label horizontal padding.
Value is in pixels, representing the distance between the text and the left and right label background borders
Default value is null
If set, this setting overrides the horizontal part of image_text_padding
@access public Typ: $type.
Definition at line 1208 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_text_padding_y |
Sets the text label vertical padding.
Value is in pixels, representing the distance between the text and the top and bottom label background borders
Default value is null
If set, his setting overrides the vertical part of image_text_padding
@access public Typ: $type.
Definition at line 1222 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_text_position |
Sets the text label position within the image.
Value is one or two out of 'TBLR' (top, bottom, left, right)
The positions are as following:
TL T TR
L R
BL B BR
Default value is null (centered, horizontal and vertical)
Note that is image_text_x and image_text_y are used, this setting has no effect
@access public Typ: $type. ;
Definition at line 1154 of file dbxUpload.class.php.
| dbxUpload::$image_text_size |
Sets the text font size for TrueType fonts.
Value is a an integer, and represents the font size in pixels (GD1) or points (GD1)
Note that this setting is only applicable to TrueType fonts, and has no effects with GD fonts
Default value is 16
@access public Typ: $type. eger;
Definition at line 1118 of file dbxUpload.class.php.
| dbxUpload::$image_text_x |
Sets the text label absolute X position within the image.
Value is in pixels, representing the distance between the left of the image and the label If a negative value is used, it will represent the distance between the right of the image and the label
Default value is null (so image_text_position is used)
@access public Typ: $type.
Definition at line 1167 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_text_y |
Sets the text label absolute Y position within the image.
Value is in pixels, representing the distance between the top of the image and the label If a negative value is used, it will represent the distance between the bottom of the image and the label
Default value is null (so image_text_position is used)
@access public Typ: $type.
Definition at line 1180 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_threshold |
Applies threshold filter.
Value can range between -127 and 127
Default value is null
@access public Typ: $type.
Definition at line 874 of file dbxUpload.class.php.
| dbxUpload::$image_tint_color |
Applies a tint on the image.
Value is an hexadecimal color, such as #FFFFFF
Default value is null
@access public Typ: $type. ;
Definition at line 886 of file dbxUpload.class.php.
| dbxUpload::$image_transparent_color |
Transparent color in a palette.
This is actually used only for transparent GIFs
@access public Typ: $type.
Definition at line 788 of file dbxUpload.class.php.
| dbxUpload::$image_unsharp |
Applies an unsharp mask, with alpha transparency support.
Beware that this unsharp mask is quite resource-intensive
Default value is FALSE
@access public Typ: $type. ean;
Definition at line 958 of file dbxUpload.class.php.
| dbxUpload::$image_unsharp_amount |
Sets the unsharp mask amount.
Value is an integer between 0 and 500, typically between 50 and 200
Unless used with image_unsharp, this setting has no effect
Default value is 80
@access public Typ: $type.
Definition at line 972 of file dbxUpload.class.php.
| dbxUpload::$image_unsharp_radius |
Sets the unsharp mask radius.
Value is an integer between 0 and 50, typically between 0.5 and 1 It is not recommended to change it, the default works best
Unless used with image_unsharp, this setting has no effect
From PHP 5.1, imageconvolution is used, and this setting has no effect
Default value is 0.5
@access public Typ: $type.
Definition at line 989 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_unsharp_threshold |
Sets the unsharp mask threshold.
Value is an integer between 0 and 255, typically between 0 and 5
Unless used with image_unsharp, this setting has no effect
Default value is 1
@access public Typ: $type.
Definition at line 1003 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_watermark |
Adds a watermark on the image.
Value is a local image filename, relative or absolute. GIF, JPG, BMP, WEBP and PNG are supported, as well as PNG and WEBP alpha.
If set, this setting allow the use of all other settings starting with image_watermark_
Default value is null
@access public Typ: $type. ;
Definition at line 1547 of file dbxUpload.class.php.
| dbxUpload::$image_watermark_no_zoom_in |
Prevents the watermark to be resized up if it is smaller than the image.
If the watermark if smaller than the destination image, taking in account the desired watermark position then it will be resized up to fill in the image (minus the image_watermark_x or image_watermark_y values)
If you don't want your watermark to be resized in any way, then set image_watermark_no_zoom_in and image_watermark_no_zoom_out to true If you want your watermark to be resized up or doan to fill in the image better, then set image_watermark_no_zoom_in and image_watermark_no_zoom_out to false
Default value is true (so the watermark will not be resized up, which is the behaviour most people expect)
@access public Typ: $type.
Definition at line 1609 of file dbxUpload.class.php.
| dbxUpload::$image_watermark_no_zoom_out |
Prevents the watermark to be resized down if it is bigger than the image.
If the watermark if bigger than the destination image, taking in account the desired watermark position then it will be resized down to fit in the image (minus the image_watermark_x or image_watermark_y values)
If you don't want your watermark to be resized in any way, then set image_watermark_no_zoom_in and image_watermark_no_zoom_out to true If you want your watermark to be resized up or doan to fill in the image better, then set image_watermark_no_zoom_in and image_watermark_no_zoom_out to false
Default value is false (so the watermark may be shrinked to fit in the image)
@access public Typ: $type.
Definition at line 1627 of file dbxUpload.class.php.
| dbxUpload::$image_watermark_position |
Sets the watermarkposition within the image.
Value is one or two out of 'TBLR' (top, bottom, left, right)
The positions are as following: TL T TR L R BL B BR
Default value is null (centered, horizontal and vertical)
Note that is image_watermark_x and image_watermark_y are used, this setting has no effect
@access public Typ: $type. ;
Definition at line 1565 of file dbxUpload.class.php.
| dbxUpload::$image_watermark_x |
Sets the watermark absolute X position within the image.
Value is in pixels, representing the distance between the top of the image and the watermark If a negative value is used, it will represent the distance between the bottom of the image and the watermark
Default value is null (so image_watermark_position is used)
@access public Typ: $type.
Definition at line 1578 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_watermark_y |
Sets the twatermark absolute Y position within the image.
Value is in pixels, representing the distance between the left of the image and the watermark If a negative value is used, it will represent the distance between the right of the image and the watermark
Default value is null (so image_watermark_position is used)
@access public Typ: $type.
Definition at line 1591 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_x |
Set this variable to the wanted (or maximum/minimum) width for the processed image, in pixels.
Default value is 150
@access public Typ: $type.
Definition at line 508 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$image_y |
Set this variable to the wanted (or maximum/minimum) height for the processed image, in pixels.
Default value is 150
@access public Typ: $type.
Definition at line 518 of file dbxUpload.class.php.
Referenced by process().
| dbxUpload::$jpeg_quality |
Quality of JPEG created/converted destination image.
Default value is 85
@access public Typ: $type.
Definition at line 732 of file dbxUpload.class.php.
| dbxUpload::$jpeg_size |
Determines the quality of the JPG image to fit a desired file size.
The JPG quality will be set between 1 and 100% The calculations are approximations.
Value in bytes (integer) or shorthand byte values (string) is allowed. The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes)
Default value is null (no calculations)
@access public Typ: $type.
Definition at line 758 of file dbxUpload.class.php.
| dbxUpload::$lang |
Language selected for the translations.
By default, the language is english ("en_GB")
@access public Typ: $type.
Definition at line 1682 of file dbxUpload.class.php.
Referenced by __construct(), and upload().
| dbxUpload::$log |
Holds an HTML formatted log.
@access public Typ: $type.
Definition at line 261 of file dbxUpload.class.php.
| dbxUpload::$mime_check |
Set this variable to false if you don't want to check the MIME against the allowed list.
This variable is set to true by default for security reason
@access public Typ: $type.
Definition at line 322 of file dbxUpload.class.php.
| dbxUpload::$mime_file |
Set this variable to false in the init() function if you don't want to check the MIME with UNIX file() command.
This variable is set to true by default for security reason
@access public Typ: $type.
Definition at line 350 of file dbxUpload.class.php.
| dbxUpload::$mime_fileinfo |
Set this variable to false in the init() function if you don't want to check the MIME with Fileinfo PECL extension.
On some systems, Fileinfo is known to be buggy, and you may want to deactivate it in the class code directly.
You can also set it with the path of the magic database file. If set to true, the class will try to read the MAGIC environment variable and if it is empty, will default to the system's default If set to an empty string, it will call finfo_open without the path argument
This variable is set to true by default for security reason
@access public Typ: $type.
Definition at line 339 of file dbxUpload.class.php.
Referenced by upload().
| dbxUpload::$mime_getimagesize |
Set this variable to false in the init() function if you don't want to check the MIME with getimagesize().
The class tries to get a MIME type from getimagesize() If no MIME is returned, it tries to guess the MIME type from the file type
This variable is set to true by default for security reason
@access public Typ: $type.
Definition at line 378 of file dbxUpload.class.php.
| dbxUpload::$mime_magic |
Set this variable to false in the init() function if you don't want to check the MIME with the magic.mime file.
The function mime_content_type() will be deprecated, and this variable will be set to false in a future release
This variable is set to true by default for security reason
@access public Typ: $type.
Definition at line 364 of file dbxUpload.class.php.
| dbxUpload::$mime_types |
List of MIME types per extension.
@access private Typ: $type.
Definition at line 1634 of file dbxUpload.class.php.
| dbxUpload::$no_script |
Set this variable to false if you don't want to turn dangerous scripts into simple text files The list of blacklisted extensions is in dangerous.
Note that this check happens before checking for forbidden MIME types or extensions If you want to forbid uploads rather than turning scripts into text files, set no_script to false and use forbidden instead
@access public Typ: $type.
Definition at line 391 of file dbxUpload.class.php.
| dbxUpload::$no_upload_check |
Flag stopping PHP upload checks.
Indicates whether we instanciated the class with a filename, in which case we will not check on the validity of the PHP upload
This flag is automatically set to true when working on a local file
Warning: for uploads, this flag MUST be set to false for security reason
@access public Typ: $type.
Definition at line 238 of file dbxUpload.class.php.
| dbxUpload::$png_compression |
Compression level for PNG images.
Between 1 (fast but large files) and 9 (slow but smaller files)
Default value is null (Zlib default)
@access public Typ: $type.
Definition at line 722 of file dbxUpload.class.php.
| dbxUpload::$processed |
Flag set after calling a process.
Indicates if the processing, and copy of the resulting file went OK
@access public Typ: $type.
Definition at line 247 of file dbxUpload.class.php.
| dbxUpload::$translation |
Array of translated error messages.
By default, the language is english (en_GB) Translations can be in separate files, in a lang/ subdirectory
@access public Typ: $type.
Definition at line 1673 of file dbxUpload.class.php.
Referenced by upload().
| dbxUpload::$uploaded |
Flag set after instanciating the class.
Indicates if the file has been uploaded properly
@access public Typ: $type.
Definition at line 224 of file dbxUpload.class.php.
| dbxUpload::$version |
| dbxUpload::$webp_quality |
Quality of WebP created/converted destination image.
Default value is 85
@access public Typ: $type.
Definition at line 742 of file dbxUpload.class.php.