Tema: Subir Imagen
Ver Mensaje Individual
  #9 (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:
 *  <pre>$handle->auto_create_dir = true;</pre></li>
 *  <li><b>dir_auto_chmod</b> automatically attempts to chmod the destination directory if not writeable (default: true)<br>
 *  <pre>$handle->dir_auto_chmod = true;</pre></li>
 *  <li><b>dir_chmod</b> chmod used when creating directory or if directory not writeable (default: 0777)<br>
 *  <pre>$handle->dir_chmod = 0777;</pre></li>
 *  <li><b>file_max_size</b> sets maximum upload size (default: upload_max_filesize from php.ini)<br>
 *  <pre>$handle->file_max_size = '1024'; // 1KB</pre></li>
 *  <li><b>mime_check</b> sets if the class check the MIME against the {@link allowed} list (default: true)<br>
 *  <pre>$handle->mime_check = false;</pre></li>
 *  <li><b>mime_magic_check</b> sets if the class uses mime_magic (default: false)<br>
 *  <pre>$handle->mime_magic_check = true;</pre></li>
 *  <li><b>no_script</b> sets if the class turns scripts into text files (default: true)<br>
 *  <pre>$handle->no_script = false;</pre></li>
 *  <li><b>allowed</b> array of allowed mime-types. wildcard accepted, as in image/* (default: check {@link Init})<br>
 *  <pre>$handle->allowed = array('application/pdf','application/msword', 'image/*');</pre></li>
 *  <li><b>forbidden</b> array of forbidden mime-types. wildcard accepted, as in image/*  (default: check {@link Init})<br>
 *  <pre>$handle->forbidden = array('application/*');</pre></li>
 * </ul>
 * <ul>
 *  <li><b>image_convert</b> if set, image will be converted (possible values : ''|'png'|'jpeg'|'gif'|'bmp'; default: '')<br>
 *  <pre>$handle->image_convert = 'jpg';</pre></li>
 *  <li><b>image_background_color</b> if set, will forcibly fill transparent areas with the color, in hexadecimal (default: null)<br>
 *  <pre>$handle->image_background_color = '#FF00FF';</pre></li>
 *  <li><b>image_default_color</b> fallback color background color for non alpha-transparent output formats, such as JPEG or BMP, in hexadecimal (default: #FFFFFF)<br>
 *  <pre>$handle->image_default_color = '#FF00FF';</pre></li>
 *  <li><b>jpeg_quality</b> sets the compression quality for JPEG images (default: 85)<br>
 *  <pre>$handle->jpeg_quality = 50;</pre></li>
 *  <li><b>jpeg_size</b> if set to a size in bytes, will approximate {@link jpeg_quality} so the output image fits within the size (default: null)<br>
 *  <pre>$handle->jpeg_size = 3072;</pre></li>
 * </ul>
 * The following eight settings can be used to invalidate an upload if the file is an image (note that <i>open_basedir</i> restrictions prevent the use of these settings)
 * <ul>
 *  <li><b>image_max_width</b> if set to a dimension in pixels, the upload will be invalid if the image width is greater (default: null)<br>
 *  <pre>$handle->image_max_width = 200;</pre></li>
 *  <li><b>image_max_height</b> if set to a dimension in pixels, the upload will be invalid if the image height is greater (default: null)<br>
 *  <pre>$handle->image_max_height = 100;</pre></li>
 *  <li><b>image_max_pixels</b> if set to a number of pixels, the upload will be invalid if the image number of pixels is greater (default: null)<br>
 *  <pre>$handle->image_max_pixels = 50000;</pre></li>
 *  <li><b>image_max_ratio</b> if set to a aspect ratio (width/height), the upload will be invalid if the image apect ratio is greater (default: null)<br>
 *  <pre>$handle->image_max_ratio = 1.5;</pre></li>
 *  <li><b>image_min_width</b> if set to a dimension in pixels, the upload will be invalid if the image width is lower (default: null)<br>
 *  <pre>$handle->image_min_width = 100;</pre></li>
 *  <li><b>image_min_height</b> if set to a dimension in pixels, the upload will be invalid if the image height is lower (default: null)<br>
 *  <pre>$handle->image_min_height = 500;</pre></li>
 *  <li><b>image_min_pixels</b> if set to a number of pixels, the upload will be invalid if the image number of pixels is lower (default: null)<br>
 *  <pre>$handle->image_min_pixels = 20000;</pre></li>
 *  <li><b>image_min_ratio</b> if set to a aspect ratio (width/height), the upload will be invalid if the image apect ratio is lower (default: null)<br>
 *  <pre>$handle->image_min_ratio = 0.5;</pre></li>
 * </ul>
 * <ul>
 *  <li><b>image_resize</b> determines is an image will be resized (default: false)<br>
 *  <pre>$handle->image_resize = true;</pre></li>
 * </ul>
 *  The following variables are used only if {@link image_resize} == true
 * <ul>
 *  <li><b>image_x</b> destination image width (default: 150)<br>
 *  <pre>$handle->image_x = 100;</pre></li>
 *  <li><b>image_y</b> destination image height (default: 150)<br>
 *  <pre>$handle->image_y = 200;</pre></li>
 * </ul>
 *  Use either one of the following
 * <ul>
 *  <li><b>image_ratio</b> if true, resize image conserving the original sizes ratio, using {@link image_x} AND {@link image_y} as max sizes if true (default: false)<br>
 *  <pre>$handle->image_ratio = true;</pre></li>
 *  <li><b>image_ratio_crop</b> if true, resize image conserving the original sizes ratio, using {@link image_x} AND {@link image_y} as max sizes, and cropping excedent to fill the space. setting can also be a string, with one or more from 'TBLR', indicating which side of the image will be kept while cropping (default: false)<br>
 *  <pre>$handle->image_ratio_crop = true;</pre></li>
 *  <li><b>image_ratio_fill</b> if true, resize image conserving the original sizes ratio, using {@link image_x} AND {@link image_y} as max sizes, fitting the image in the space and coloring the remaining space. setting can also be a string, with one or more from 'TBLR', indicating which side of the space the image will be in (default: false)<br>
 *  <pre>$handle->image_ratio_fill = true;</pre></li>
 *  <li><b>image_ratio_no_zoom_in</b> same as {@link image_ratio}, but won't resize if the source image is smaller than {@link image_x} x {@link image_y} (default: false)<br>
 *  <pre>$handle->image_ratio_no_zoom_in = true;</pre></li>
 *  <li><b>image_ratio_no_zoom_out</b> same as {@link image_ratio}, but won't resize if the source image is bigger than {@link image_x} x {@link image_y} (default: false)<br>
 *  <pre>$handle->image_ratio_no_zoom_out = true;</pre></li>
 *  <li><b>image_ratio_x</b> if true, resize image, calculating {@link image_x} from {@link image_y} and conserving the original sizes ratio (default: false)<br>
 *  <pre>$handle->image_ratio_x = true;</pre></li>
 *  <li><b>image_ratio_y</b> if true, resize image, calculating {@link image_y} from {@link image_x} and conserving the original sizes ratio (default: false)<br>
 *  <pre>$handle->image_ratio_y = true;</pre></li>
 *  <li><b>image_ratio_pixels</b> if set to a long integer, resize image, calculating {@link image_y} and {@link image_x} to match a the number of pixels (default: false)<br>
 *  <pre>$handle->image_ratio_pixels = 25000;</pre></li>
 * </ul>
 *  The following image manipulations require GD2+
 * <ul>
 *  <li><b>image_brightness</b> if set, corrects the brightness. value between -127 and 127 (default: null)<br>
 *  <pre>$handle->image_brightness = 40;</pre></li>
 *  <li><b>image_contrast</b> if set, corrects the contrast. value between -127 and 127 (default: null)<br>
 *  <pre>$handle->image_contrast = 50;</pre></li>
 *  <li><b>image_tint_color</b> if set, will tint the image with a color, value as hexadecimal #FFFFFF (default: null)<br>
 *  <pre>$handle->image_tint_color = '#FF0000';</pre></li>
 *  <li><b>image_overlay_color</b> if set, will add a colored overlay, value as hexadecimal #FFFFFF (default: null)<br>
 *  <pre>$handle->image_overlay_color = '#FF0000';</pre></li>
 *  <li><b>image_overlay_percent</b> used when {@link image_overlay_color} is set, determines the opacity (default: 50)<br>
 *  <pre>$handle->image_overlay_percent = 20;</pre></li>
 *  <li><b>image_negative</b> inverts the colors in the image (default: false)<br>
 *  <pre>$handle->image_negative = true;</pre></li>
 *  <li><b>image_greyscale</b> transforms an image into greyscale (default: false)<br>
 *  <pre>$handle->image_greyscale = true;</pre></li>
 *  <li><b>image_threshold</b> applies a threshold filter. value between -127 and 127 (default: null)<br>
 *  <pre>$handle->image_threshold = 20;</pre></li>
 * </ul>