Tema: Subir Imagen
Ver Mensaje Individual
  #10 (permalink)  
Antiguo 16/02/2008, 23:37
Avatar de elfran222
elfran222
 
Fecha de Ingreso: junio-2006
Mensajes: 550
Antigüedad: 17 años, 10 meses
Puntos: 7
Re: Subir Imagen

Continuación class.upload.php
Código:
 * <ul>
 *  <li><b>image_text</b> creates a text label on the image, value is a string, with eventual replacement tokens (default: null)<br>
 *  <pre>$handle->image_text = 'test';</pre></li>
 *  <li><b>image_text_direction</b> text label direction, either 'h' horizontal or 'v' vertical (default: 'h')<br>
 *  <pre>$handle->image_text_direction = 'v';</pre></li>
 *  <li><b>image_text_color</b> text color for the text label, in hexadecimal (default: #FFFFFF)<br>
 *  <pre>$handle->image_text_color = '#FF0000';</pre></li>
 *  <li><b>image_text_percent</b> text opacity on the text label, integer between 0 and 100 (default: 100)<br>
 *  <pre>$handle->image_text_percent = 50;</pre></li>
 *  <li><b>image_text_background</b> text label background color, in hexadecimal (default: null)<br>
 *  <pre>$handle->image_text_background = '#FFFFFF';</pre></li>
 *  <li><b>image_text_background_percent</b> text label background opacity, integer between 0 and 100 (default: 100)<br>
 *  <pre>$handle->image_text_background_percent = 50;</pre></li>
 *  <li><b>image_text_font</b> built-in font for the text label, from 1 to 5. 1 is the smallest (default: 5)<br>
 *  <pre>$handle->image_text_font = 4;</pre></li>
 *  <li><b>image_text_x</b> absolute text label position, in pixels from the left border. can be negative (default: null)<br>
 *  <pre>$handle->image_text_x = 5;</pre></li>
 *  <li><b>image_text_y</b> absolute text label position, in pixels from the top border. can be negative (default: null)<br>
 *  <pre>$handle->image_text_y = 5;</pre></li>
 *  <li><b>image_text_position</b> text label position withing the image, a combination of one or two from 'TBLR': top, bottom, left, right (default: null)<br>
 *  <pre>$handle->image_text_position = 'LR';</pre></li>
 *  <li><b>image_text_padding</b> text label padding, in pixels. can be overridden by {@link image_text_padding_x} and {@link image_text_padding_y} (default: 0)<br>
 *  <pre>$handle->image_text_padding = 5;</pre></li>
 *  <li><b>image_text_padding_x</b> text label horizontal padding (default: null)<br>
 *  <pre>$handle->image_text_padding_x = 2;</pre></li>
 *  <li><b>image_text_padding_y</b> text label vertical padding (default: null)<br>
 *  <pre>$handle->image_text_padding_y = 10;</pre></li>
 *  <li><b>image_text_alignment</b> text alignment when text has multiple lines, either 'L', 'C' or 'R' (default: 'C')<br>
 *  <pre>$handle->image_text_alignment = 'R';</pre></li>
 *  <li><b>image_text_line_spacing</b> space between lines in pixels, when text has multiple lines (default: 0)<br>
 *  <pre>$handle->image_text_line_spacing = 3;</pre></li>
 * </ul>
 * <ul>
 *  <li><b>image_flip</b> flips image, wither 'h' horizontal or 'v' vertical (default: null)<br>
 *  <pre>$handle->image_flip = 'h';</pre></li>
 *  <li><b>image_rotate</b> rotates image. possible values are 90, 180 and 270 (default: null)<br>
 *  <pre>$handle->image_rotate = 90;</pre></li>
 *  <li><b>image_crop</b> crops image. accepts 4, 2 or 1 values as 'T R B L' or 'TB LR' or 'TBLR'. dimension can be 20, or 20px or 20% (default: null)<br>
 *  <pre>$handle->image_crop = array(50,40,30,20); OR '-20 20%'...</pre></li>
 * </ul>
 * <ul>
 *  <li><b>image_bevel</b> adds a bevel border to the image. value is thickness in pixels (default: null)<br>
 *  <pre>$handle->image_bevel = 20;</pre></li>
 *  <li><b>image_bevel_color1</b> top and left bevel color, in hexadecimal (default: #FFFFFF)<br>
 *  <pre>$handle->image_bevel_color1 = '#FFFFFF';</pre></li>
 *  <li><b>image_bevel_color2</b> bottom and right bevel color, in hexadecimal (default: #000000)<br>
 *  <pre>$handle->image_bevel_color2 = '#000000';</pre></li>
 *  <li><b>image_border</b> adds a unicolor border to the image. accepts 4, 2 or 1 values as 'T R B L' or 'TB LR' or 'TBLR'. dimension can be 20, or 20px or 20% (default: null)<br>
 *  <pre>$handle->image_border = '3px'; OR '-20 20%' OR array(3,2)...</pre></li>
 *  <li><b>image_border_color</b> border color, in hexadecimal (default: #FFFFFF)<br>
 *  <pre>$handle->image_border_color = '#FFFFFF';</pre></li>
 *  <li><b>image_frame</b> type of frame: 1=flat 2=crossed (default: null)<br>
 *  <pre>$handle->image_frame = 2;</pre></li>
 *  <li><b>image_frame_colors</b> list of hex colors, in an array or a space separated string (default: '#FFFFFF #999999 #666666 #000000')<br>
 *  <pre>$handle->image_frame_colors = array('#999999',  '#FF0000', '#666666', '#333333', '#000000');</pre></li>
 * </ul>
 * <ul>
 *  <li><b>image_watermark</b> adds a watermark on the image, value is a local filename. accepted files are GIF, JPG, BMP, PNG and PNG alpha (default: null)<br>
 *  <pre>$handle->image_watermark = 'watermark.png';</pre></li>
 *  <li><b>image_watermark_x</b> absolute watermark position, in pixels from the left border. can be negative (default: null)<br>
 *  <pre>$handle->image_watermark_x = 5;</pre></li>
 *  <li><b>image_watermark_y</b> absolute watermark position, in pixels from the top border. can be negative (default: null)<br>
 *  <pre>$handle->image_watermark_y = 5;</pre></li>
 *  <li><b>image_watermark_position</b> watermark position withing the image, a combination of one or two from 'TBLR': top, bottom, left, right (default: null)<br>
 *  <pre>$handle->image_watermark_position = 'LR';</pre></li>
 * </ul>
 * <ul>
 *  <li><b>image_reflection_height</b> if set, a reflection will be added. Format is either in pixels or percentage, such as 40, '40', '40px' or '40%' (default: null)<br>
 *  <pre>$handle->image_reflection_height = '25%';</pre></li>
 *  <li><b>image_reflection_space</b> space in pixels between the source image and the reflection, can be negative (default: null)<br>
 *  <pre>$handle->image_reflection_space = 3;</pre></li>
 *  <li><b>image_reflection_color</b> reflection background color, in hexadecimal. Now deprecated in favor of {@link image_default_color} (default: #FFFFFF)<br>
 *  <pre>$handle->image_default_color = '#000000';</pre></li> 
 *  <li><b>image_reflection_opacity</b> opacity level at which the reflection starts, integer between 0 and 100 (default: 60)<br>
 *  <pre>$handle->image_reflection_opacity = 60;</pre></li>
 * </ul>
 *
 * <b>Values that can be read before calling {@link process}()</b>
 * <ul>
 *  <li><b>file_src_name</b> Source file name</li>
 *  <li><b>file_src_name_body</b> Source file name body</li>
 *  <li><b>file_src_name_ext</b> Source file extension</li>
 *  <li><b>file_src_pathname</b> Source file complete path and name</li>
 *  <li><b>file_src_mime</b> Source file mime type</li>
 *  <li><b>file_src_size</b> Source file size in bytes</li>
 *  <li><b>file_src_error</b> Upload error code</li>
 *  <li><b>file_is_image</b> Boolean flag, true if the file is a supported image type</li>
 * </ul>
 * If the file is a supported image type (and <i>open_basedir</i> restrictions allow it)
 * <ul>
 *  <li><b>image_src_x</b> Source file width in pixels</li>
 *  <li><b>image_src_y</b> Source file height in pixels</li>
 *  <li><b>image_src_pixels</b> Source file number of pixels</li>
 *  <li><b>image_src_type</b> Source file type (png, jpg, gif or bmp)</li>
 *  <li><b>image_src_bits</b> Source file color depth</li>
 * </ul>
 *
 * <b>Values that can be read before after {@link process}()</b>
 * <ul>
 *  <li><b>file_dst_path</b> Destination file path</li>
 *  <li><b>file_dst_name_body</b> Destination file name body</li>
 *  <li><b>file_dst_name_ext</b> Destination file extension</li>
 *  <li><b>file_dst_name</b> Destination file name</li>
 *  <li><b>file_dst_pathname</b> Destination file complete path and name</li>
 * </ul>
 * If the file is a supported image type
 * <ul>
 *  <li><b>image_dst_x</b> Destination file width</li>
 *  <li><b>image_dst_y</b> Destination file height</li>
 *  <li><b>image_convert</b> Destination file format</li>
 * </ul>
 *
 * <b>Requirements</b>
 *
 * Most of the image operations require GD. GD2 is greatly recommended
 *
 * The class is compatible with PHP 4.3+, and compatible with PHP5