dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches

Class upload. More...

Inheritance diagram for dbxUpload:
myUpload

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.

Detailed Description

Class upload.

Author
Colin Verot colin.nosp@m.@ver.nosp@m.ot.ne.nosp@m.t @license http://opensource.org/licenses/gpl-license.php GNU Public License

Definition at line 39 of file dbxUpload.class.php.

Constructor & Destructor Documentation

◆ __construct()

dbxUpload::__construct ( $file = '',
$lang = 'en_GB' )

Constructor, for PHP5+.

Definition at line 2037 of file dbxUpload.class.php.

References $file, $lang, and upload().

Member Function Documentation

◆ _mkdir()

dbxUpload::_mkdir ( $path,
$mode = 0755 )

Creates directory.

@access private

Parameters
string$pathPath to create
integer$modeOptional permissions
Returns
boolean Success

Definition at line 2704 of file dbxUpload.class.php.

References $mode.

Referenced by rmkdir().

◆ clean()

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.

◆ function_enabled()

dbxUpload::function_enabled ( $func)

Checks if a function is available.

@access private

Parameters
string$funcFunction name
Returns
boolean Success

Definition at line 2673 of file dbxUpload.class.php.

References $disabled.

Referenced by gdversion(), process(), temp_dir(), and upload().

◆ gdversion()

dbxUpload::gdversion ( $full = false)

Returns the version of GD.

@access public

Parameters
boolean$fullOptional flag to get precise version
Returns
float GD version

Definition at line 2636 of file dbxUpload.class.php.

References function_enabled().

Referenced by imagecreatenew(), process(), and upload().

◆ getcolors()

dbxUpload::getcolors ( $color)

Decodes colors.

@access private

Parameters
string$colorColor string
Returns
array RGB colors

Definition at line 2797 of file dbxUpload.class.php.

Referenced by imagecreatenew(), and process().

◆ getoffsets()

dbxUpload::getoffsets ( $offsets,
$x,
$y,
$round = true,
$negative = true )

Decodes offsets.

@access private

Parameters
misc$offsetsOffsets, as an integer, a string or an array
integer$xReference picture width
integer$yReference picture height
boolean$roundRound offsets before returning them
boolean$negativeAllow negative offsets to be returned
Returns
array Array of four offsets (TRBL)

Definition at line 2840 of file dbxUpload.class.php.

Referenced by process().

◆ getsize()

dbxUpload::getsize ( $size)

Decodes sizes.

@access private

Parameters
string$sizeSize in bytes, or shorthand byte options
Returns
integer Size in bytes

Definition at line 2814 of file dbxUpload.class.php.

Referenced by init(), and process().

◆ imagebmp()

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().

◆ imagecopymergealpha()

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:

$upload->imagecopymergealpha($dst, $watermark, 20, 20, 0, 0, 180, 80, 60);

Result: $watermark is blended into $dst at position 20/20 with 60 percent opacity.

@access private

Parameters
resource | \GdImage$dst_imDestination image, modified in place.
resource | \GdImage$src_imSource/overlay image.
int$dst_xX-coordinate in the destination image.
int$dst_yY-coordinate in the destination image.
int$src_xX-coordinate in the source image.
int$src_yY-coordinate in the source image.
int$src_wWidth of the source area.
int$src_hHeight of the source area.
int$pctOverlay opacity from 0 to 100.
Returns
resource|\GdImage Destination image.

Definition at line 2969 of file dbxUpload.class.php.

Referenced by process().

◆ imagecreatefrombmp()

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().

◆ imagecreatenew()

dbxUpload::imagecreatenew ( $x,
$y,
$fill = true,
$trsp = false )

Creates a container image.

@access private

Parameters
integer$xWidth
integer$yHeight
boolean$fillOptional flag to draw the background color or not
boolean$trspOptional flag to set the background to be transparent
Returns
resource Container image

Definition at line 2883 of file dbxUpload.class.php.

References gdversion(), and getcolors().

Referenced by process().

◆ imagetransfer()

dbxUpload::imagetransfer ( $src_im,
$dst_im )

Transfers an image from the container to the destination image.

@access private

Parameters
resource$src_imContainer image
resource$dst_imDestination image
Returns
resource Destination image

Definition at line 2921 of file dbxUpload.class.php.

References imageunset().

Referenced by process().

◆ imageunset()

dbxUpload::imageunset ( $im)

Destroy GD ressource.

@access private

Parameters
resource$imImage

Definition at line 2933 of file dbxUpload.class.php.

Referenced by imagebmp(), imagetransfer(), and process().

◆ init()

dbxUpload::init ( )

Init or re-init all the processing variables to their default values.

This function is called in the constructor, and after each call of process

@access private

Definition at line 1691 of file dbxUpload.class.php.

References getsize().

Referenced by process(), and upload().

◆ process()

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

Parameters
string$server_pathOptional path location of the uploaded file, with an ending slash
Returns
string Optional content of the image

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().

◆ rmkdir()

dbxUpload::rmkdir ( $path,
$mode = 0755 )

Creates directories recursively.

@access private

Parameters
string$pathPath to create
integer$modeOptional permissions
Returns
boolean Success

Definition at line 2692 of file dbxUpload.class.php.

References $mode, _mkdir(), and rmkdir().

Referenced by process(), and rmkdir().

◆ sanitize()

dbxUpload::sanitize ( $filename)

Sanitize a file name.

@access private

Parameters
string$filenameFile name
Returns
string Sanitized file name

Definition at line 2757 of file dbxUpload.class.php.

Referenced by process().

◆ temp_dir()

dbxUpload::temp_dir ( )

Returns the temp directory.

@access private

Returns
string Temp directory string

Definition at line 2731 of file dbxUpload.class.php.

References $dir, $tmp, and function_enabled().

Referenced by upload().

◆ translate()

dbxUpload::translate ( $str,
$tokens = array() )

Translate error messages.

@access private

Parameters
string$strMessage to translate
array$tokensOptional token values
Returns
string Translated string

Definition at line 2719 of file dbxUpload.class.php.

Referenced by process(), and upload().

◆ upload()

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

Parameters
array$file$_FILES['form_field'] or string $file Local filename
string$langOptional 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().

Member Data Documentation

◆ $allowed

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().

◆ $dangerous

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.

◆ $dir_auto_chmod

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.

◆ $dir_auto_create

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.

◆ $dir_chmod

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.

◆ $error

dbxUpload::$error

Holds eventual error message in plain english.

@access public Typ: $type.

Definition at line 254 of file dbxUpload.class.php.

◆ $file_auto_rename

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.

◆ $file_dst_name

dbxUpload::$file_dst_name

Destination file name.

@access public Typ: $type.

Definition at line 117 of file dbxUpload.class.php.

Referenced by process().

◆ $file_dst_name_body

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().

◆ $file_dst_name_ext

dbxUpload::$file_dst_name_ext

Destination file extension.

@access public Typ: $type.

Definition at line 131 of file dbxUpload.class.php.

◆ $file_dst_path

dbxUpload::$file_dst_path

Destination file name.

@access public Typ: $type.

Definition at line 110 of file dbxUpload.class.php.

◆ $file_dst_pathname

dbxUpload::$file_dst_pathname

Destination file name, including path.

@access public Typ: $type.

Definition at line 138 of file dbxUpload.class.php.

◆ $file_force_extension

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.

◆ $file_is_image

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.

◆ $file_max_size

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().

◆ $file_max_size_raw

dbxUpload::$file_max_size_raw

Max file size, from php.ini.

@access private Typ: $type.

Definition at line 475 of file dbxUpload.class.php.

◆ $file_name_body_add

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().

◆ $file_name_body_pre

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.

◆ $file_new_name_body

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().

◆ $file_new_name_ext

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().

◆ $file_overwrite

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.

◆ $file_safe_name

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.

◆ $file_src_error

dbxUpload::$file_src_error

Holds eventual PHP error code from $_FILES.

@access public Typ: $type.

Definition at line 89 of file dbxUpload.class.php.

◆ $file_src_mime

dbxUpload::$file_src_mime

Uploaded file MIME type.

@access public Typ: $type.

Definition at line 75 of file dbxUpload.class.php.

Referenced by upload().

◆ $file_src_name

dbxUpload::$file_src_name

Uploaded file name.

@access public Typ: $type.

Definition at line 54 of file dbxUpload.class.php.

Referenced by process(), and upload().

◆ $file_src_name_body

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().

◆ $file_src_name_ext

dbxUpload::$file_src_name_ext

Uploaded file name extension.

@access public Typ: $type.

Definition at line 68 of file dbxUpload.class.php.

Referenced by process(), and upload().

◆ $file_src_pathname

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().

◆ $file_src_size

dbxUpload::$file_src_size

Uploaded file size, in bytes.

@access public Typ: $type.

Definition at line 82 of file dbxUpload.class.php.

◆ $file_src_temp

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().

◆ $forbidden

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.

◆ $image_auto_rotate

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.

◆ $image_background_color

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().

◆ $image_bevel

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().

◆ $image_bevel_color1

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.

◆ $image_bevel_color2

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.

◆ $image_border

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.

◆ $image_border_color

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.

◆ $image_border_opacity

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.

◆ $image_border_transparent

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.

◆ $image_brightness

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.

◆ $image_contrast

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.

◆ $image_convert

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().

◆ $image_crop

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.

◆ $image_default_color

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().

◆ $image_dst_type

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.

◆ $image_dst_x

dbxUpload::$image_dst_x

Destination image width.

@access public Typ: $type.

Definition at line 184 of file dbxUpload.class.php.

Referenced by process().

◆ $image_dst_y

dbxUpload::$image_dst_y

Destination image height.

@access public Typ: $type.

Definition at line 192 of file dbxUpload.class.php.

Referenced by process().

◆ $image_flip

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.

◆ $image_frame

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.

◆ $image_frame_colors

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().

◆ $image_frame_opacity

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.

◆ $image_greyscale

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.

◆ $image_interlace

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.

◆ $image_is_palette

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.

◆ $image_is_transparent

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.

◆ $image_max_height

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.

◆ $image_max_pixels

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.

◆ $image_max_ratio

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.

◆ $image_max_width

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.

◆ $image_min_height

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.

◆ $image_min_pixels

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.

◆ $image_min_ratio

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.

◆ $image_min_width

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.

◆ $image_negative

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.

◆ $image_no_enlarging

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.

◆ $image_no_shrinking

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.

◆ $image_opacity

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.

◆ $image_overlay_color

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.

◆ $image_overlay_opacity

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.

◆ $image_pixelate

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.

◆ $image_precrop

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.

◆ $image_ratio

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.

◆ $image_ratio_crop

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.

◆ $image_ratio_fill

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.

◆ $image_ratio_no_zoom_in

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.

◆ $image_ratio_no_zoom_out

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.

◆ $image_ratio_pixels

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.

◆ $image_ratio_x

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.

◆ $image_ratio_y

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.

◆ $image_reflection_height

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().

◆ $image_reflection_opacity

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().

◆ $image_reflection_space

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().

◆ $image_resize

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.

◆ $image_rotate

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.

◆ $image_src_bits

dbxUpload::$image_src_bits

Source image color depth.

@access public Typ: $type.

Definition at line 162 of file dbxUpload.class.php.

◆ $image_src_pixels

dbxUpload::$image_src_pixels

Number of pixels.

@access public Typ: $type.

Definition at line 169 of file dbxUpload.class.php.

◆ $image_src_type

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().

◆ $image_src_x

dbxUpload::$image_src_x

Source image width.

@access public Typ: $type.

Definition at line 146 of file dbxUpload.class.php.

Referenced by process(), and upload().

◆ $image_src_y

dbxUpload::$image_src_y

Source image height.

@access public Typ: $type.

Definition at line 154 of file dbxUpload.class.php.

Referenced by process(), and upload().

◆ $image_supported

dbxUpload::$image_supported

Supported image formats.

@access private Typ: $type.

Definition at line 207 of file dbxUpload.class.php.

◆ $image_text

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().

◆ $image_text_alignment

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.

◆ $image_text_angle

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.

◆ $image_text_background

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.

◆ $image_text_background_opacity

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.

◆ $image_text_color

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.

◆ $image_text_direction

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.

◆ $image_text_font

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().

◆ $image_text_line_spacing

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.

◆ $image_text_opacity

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.

◆ $image_text_padding

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().

◆ $image_text_padding_x

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().

◆ $image_text_padding_y

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().

◆ $image_text_position

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.

◆ $image_text_size

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.

◆ $image_text_x

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().

◆ $image_text_y

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().

◆ $image_threshold

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.

◆ $image_tint_color

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.

◆ $image_transparent_color

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.

◆ $image_unsharp

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.

◆ $image_unsharp_amount

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.

◆ $image_unsharp_radius

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().

◆ $image_unsharp_threshold

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().

◆ $image_watermark

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.

◆ $image_watermark_no_zoom_in

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.

◆ $image_watermark_no_zoom_out

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.

◆ $image_watermark_position

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.

◆ $image_watermark_x

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().

◆ $image_watermark_y

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().

◆ $image_x

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().

◆ $image_y

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().

◆ $jpeg_quality

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.

◆ $jpeg_size

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.

◆ $lang

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().

◆ $log

dbxUpload::$log

Holds an HTML formatted log.

@access public Typ: $type.

Definition at line 261 of file dbxUpload.class.php.

◆ $mime_check

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.

◆ $mime_file

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.

◆ $mime_fileinfo

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().

◆ $mime_getimagesize

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.

◆ $mime_magic

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.

◆ $mime_types

dbxUpload::$mime_types

List of MIME types per extension.

@access private Typ: $type.

Definition at line 1634 of file dbxUpload.class.php.

◆ $no_script

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.

◆ $no_upload_check

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.

◆ $png_compression

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.

◆ $processed

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.

◆ $translation

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().

◆ $uploaded

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.

◆ $version

dbxUpload::$version

Class version.

@access public Typ: $type.

Definition at line 47 of file dbxUpload.class.php.

◆ $webp_quality

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.


The documentation for this class was generated from the following file: