PageRenderTime 50ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 1ms

/lib/external/class.upload/class.upload.php

https://bitbucket.org/navigatecms/navigatecms
PHP | 5000 lines | 2883 code | 349 blank | 1768 comment | 987 complexity | 6d150dc576d8058d87544c4fd1a4f1c0 MD5 | raw file
Possible License(s): GPL-2.0, MIT, LGPL-2.1, BSD-3-Clause, AGPL-3.0, Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. // +------------------------------------------------------------------------+
  3. // | class.upload.php |
  4. // +------------------------------------------------------------------------+
  5. // | Copyright (c) Colin Verot 2003-2014. All rights reserved. |
  6. // | Email colin@verot.net |
  7. // | Web http://www.verot.net |
  8. // +------------------------------------------------------------------------+
  9. // | This program is free software; you can redistribute it and/or modify |
  10. // | it under the terms of the GNU General Public License version 2 as |
  11. // | published by the Free Software Foundation. |
  12. // | |
  13. // | This program is distributed in the hope that it will be useful, |
  14. // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
  15. // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
  16. // | GNU General Public License for more details. |
  17. // | |
  18. // | You should have received a copy of the GNU General Public License |
  19. // | along with this program; if not, write to the |
  20. // | Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
  21. // | Boston, MA 02111-1307 USA |
  22. // | |
  23. // | Please give credit on sites that use class.upload and submit changes |
  24. // | of the script so other people can use them as well. |
  25. // | This script is free to use, don't abuse. |
  26. // +------------------------------------------------------------------------+
  27. /**
  28. * Class upload
  29. *
  30. * @author Colin Verot <colin@verot.net>
  31. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  32. * @copyright Colin Verot
  33. */
  34. class upload {
  35. /**
  36. * Class version
  37. *
  38. * @access public
  39. * @var string
  40. */
  41. var $version;
  42. /**
  43. * Uploaded file name
  44. *
  45. * @access public
  46. * @var string
  47. */
  48. var $file_src_name;
  49. /**
  50. * Uploaded file name body (i.e. without extension)
  51. *
  52. * @access public
  53. * @var string
  54. */
  55. var $file_src_name_body;
  56. /**
  57. * Uploaded file name extension
  58. *
  59. * @access public
  60. * @var string
  61. */
  62. var $file_src_name_ext;
  63. /**
  64. * Uploaded file MIME type
  65. *
  66. * @access public
  67. * @var string
  68. */
  69. var $file_src_mime;
  70. /**
  71. * Uploaded file size, in bytes
  72. *
  73. * @access public
  74. * @var double
  75. */
  76. var $file_src_size;
  77. /**
  78. * Holds eventual PHP error code from $_FILES
  79. *
  80. * @access public
  81. * @var string
  82. */
  83. var $file_src_error;
  84. /**
  85. * Uloaded file name, including server path
  86. *
  87. * @access public
  88. * @var string
  89. */
  90. var $file_src_pathname;
  91. /**
  92. * Uloaded file name temporary copy
  93. *
  94. * @access private
  95. * @var string
  96. */
  97. var $file_src_temp;
  98. /**
  99. * Destination file name
  100. *
  101. * @access public
  102. * @var string
  103. */
  104. var $file_dst_path;
  105. /**
  106. * Destination file name
  107. *
  108. * @access public
  109. * @var string
  110. */
  111. var $file_dst_name;
  112. /**
  113. * Destination file name body (i.e. without extension)
  114. *
  115. * @access public
  116. * @var string
  117. */
  118. var $file_dst_name_body;
  119. /**
  120. * Destination file extension
  121. *
  122. * @access public
  123. * @var string
  124. */
  125. var $file_dst_name_ext;
  126. /**
  127. * Destination file name, including path
  128. *
  129. * @access public
  130. * @var string
  131. */
  132. var $file_dst_pathname;
  133. /**
  134. * Source image width
  135. *
  136. * @access public
  137. * @var integer
  138. */
  139. var $image_src_x;
  140. /**
  141. * Source image height
  142. *
  143. * @access public
  144. * @var integer
  145. */
  146. var $image_src_y;
  147. /**
  148. * Source image color depth
  149. *
  150. * @access public
  151. * @var integer
  152. */
  153. var $image_src_bits;
  154. /**
  155. * Number of pixels
  156. *
  157. * @access public
  158. * @var long
  159. */
  160. var $image_src_pixels;
  161. /**
  162. * Type of image (png, gif, jpg or bmp)
  163. *
  164. * @access public
  165. * @var string
  166. */
  167. var $image_src_type;
  168. /**
  169. * Destination image width
  170. *
  171. * @access public
  172. * @var integer
  173. */
  174. var $image_dst_x;
  175. /**
  176. * Destination image height
  177. *
  178. * @access public
  179. * @var integer
  180. */
  181. var $image_dst_y;
  182. /**
  183. * Destination image type (png, gif, jpg or bmp)
  184. *
  185. * @access public
  186. * @var integer
  187. */
  188. var $image_dst_type;
  189. /**
  190. * Supported image formats
  191. *
  192. * @access private
  193. * @var array
  194. */
  195. var $image_supported;
  196. /**
  197. * Flag to determine if the source file is an image
  198. *
  199. * @access public
  200. * @var boolean
  201. */
  202. var $file_is_image;
  203. /**
  204. * Flag set after instanciating the class
  205. *
  206. * Indicates if the file has been uploaded properly
  207. *
  208. * @access public
  209. * @var bool
  210. */
  211. var $uploaded;
  212. /**
  213. * Flag stopping PHP upload checks
  214. *
  215. * Indicates whether we instanciated the class with a filename, in which case
  216. * we will not check on the validity of the PHP *upload*
  217. *
  218. * This flag is automatically set to true when working on a local file
  219. *
  220. * Warning: for uploads, this flag MUST be set to false for security reason
  221. *
  222. * @access public
  223. * @var bool
  224. */
  225. var $no_upload_check;
  226. /**
  227. * Flag set after calling a process
  228. *
  229. * Indicates if the processing, and copy of the resulting file went OK
  230. *
  231. * @access public
  232. * @var bool
  233. */
  234. var $processed;
  235. /**
  236. * Holds eventual error message in plain english
  237. *
  238. * @access public
  239. * @var string
  240. */
  241. var $error;
  242. /**
  243. * Holds an HTML formatted log
  244. *
  245. * @access public
  246. * @var string
  247. */
  248. var $log;
  249. // overiddable processing variables
  250. /**
  251. * Set this variable to replace the name body (i.e. without extension)
  252. *
  253. * @access public
  254. * @var string
  255. */
  256. var $file_new_name_body;
  257. /**
  258. * Set this variable to append a string to the file name body
  259. *
  260. * @access public
  261. * @var string
  262. */
  263. var $file_name_body_add;
  264. /**
  265. * Set this variable to prepend a string to the file name body
  266. *
  267. * @access public
  268. * @var string
  269. */
  270. var $file_name_body_pre;
  271. /**
  272. * Set this variable to change the file extension
  273. *
  274. * @access public
  275. * @var string
  276. */
  277. var $file_new_name_ext;
  278. /**
  279. * Set this variable to format the filename (spaces changed to _)
  280. *
  281. * @access public
  282. * @var boolean
  283. */
  284. var $file_safe_name;
  285. /**
  286. * Forces an extension if the source file doesn't have one
  287. *
  288. * If the file is an image, then the correct extension will be added
  289. * Otherwise, a .txt extension will be chosen
  290. *
  291. * @access public
  292. * @var boolean
  293. */
  294. var $file_force_extension;
  295. /**
  296. * Set this variable to false if you don't want to check the MIME against the allowed list
  297. *
  298. * This variable is set to true by default for security reason
  299. *
  300. * @access public
  301. * @var boolean
  302. */
  303. var $mime_check;
  304. /**
  305. * Set this variable to false in the init() function if you don't want to check the MIME
  306. * with Fileinfo PECL extension. On some systems, Fileinfo is known to be buggy, and you
  307. * may want to deactivate it in the class code directly.
  308. *
  309. * You can also set it with the path of the magic database file.
  310. * If set to true, the class will try to read the MAGIC environment variable
  311. * and if it is empty, will default to the system's default
  312. * If set to an empty string, it will call finfo_open without the path argument
  313. *
  314. * This variable is set to true by default for security reason
  315. *
  316. * @access public
  317. * @var boolean
  318. */
  319. var $mime_fileinfo;
  320. /**
  321. * Set this variable to false in the init() function if you don't want to check the MIME
  322. * with UNIX file() command
  323. *
  324. * This variable is set to true by default for security reason
  325. *
  326. * @access public
  327. * @var boolean
  328. */
  329. var $mime_file;
  330. /**
  331. * Set this variable to false in the init() function if you don't want to check the MIME
  332. * with the magic.mime file
  333. *
  334. * The function mime_content_type() will be deprecated,
  335. * and this variable will be set to false in a future release
  336. *
  337. * This variable is set to true by default for security reason
  338. *
  339. * @access public
  340. * @var boolean
  341. */
  342. var $mime_magic;
  343. /**
  344. * Set this variable to false in the init() function if you don't want to check the MIME
  345. * with getimagesize()
  346. *
  347. * The class tries to get a MIME type from getimagesize()
  348. * If no MIME is returned, it tries to guess the MIME type from the file type
  349. *
  350. * This variable is set to true by default for security reason
  351. *
  352. * @access public
  353. * @var boolean
  354. */
  355. var $mime_getimagesize;
  356. /**
  357. * Set this variable to false if you don't want to turn dangerous scripts into simple text files
  358. *
  359. * @access public
  360. * @var boolean
  361. */
  362. var $no_script;
  363. /**
  364. * Set this variable to true to allow automatic renaming of the file
  365. * if the file already exists
  366. *
  367. * Default value is true
  368. *
  369. * For instance, on uploading foo.ext,<br>
  370. * if foo.ext already exists, upload will be renamed foo_1.ext<br>
  371. * and if foo_1.ext already exists, upload will be renamed foo_2.ext<br>
  372. *
  373. * Note that this option doesn't have any effect if {@link file_overwrite} is true
  374. *
  375. * @access public
  376. * @var bool
  377. */
  378. var $file_auto_rename;
  379. /**
  380. * Set this variable to true to allow automatic creation of the destination
  381. * directory if it is missing (works recursively)
  382. *
  383. * Default value is true
  384. *
  385. * @access public
  386. * @var bool
  387. */
  388. var $dir_auto_create;
  389. /**
  390. * Set this variable to true to allow automatic chmod of the destination
  391. * directory if it is not writeable
  392. *
  393. * Default value is true
  394. *
  395. * @access public
  396. * @var bool
  397. */
  398. var $dir_auto_chmod;
  399. /**
  400. * Set this variable to the default chmod you want the class to use
  401. * when creating directories, or attempting to write in a directory
  402. *
  403. * Default value is 0777 (without quotes)
  404. *
  405. * @access public
  406. * @var bool
  407. */
  408. var $dir_chmod;
  409. /**
  410. * Set this variable tu true to allow overwriting of an existing file
  411. *
  412. * Default value is false, so no files will be overwritten
  413. *
  414. * @access public
  415. * @var bool
  416. */
  417. var $file_overwrite;
  418. /**
  419. * Set this variable to change the maximum size in bytes for an uploaded file
  420. *
  421. * Default value is the value <i>upload_max_filesize</i> from php.ini
  422. *
  423. * Value in bytes (integer) or shorthand byte values (string) is allowed.
  424. * The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes)
  425. *
  426. * @access public
  427. * @var double
  428. */
  429. var $file_max_size;
  430. /**
  431. * Set this variable to true to resize the file if it is an image
  432. *
  433. * You will probably want to set {@link image_x} and {@link image_y}, and maybe one of the ratio variables
  434. *
  435. * Default value is false (no resizing)
  436. *
  437. * @access public
  438. * @var bool
  439. */
  440. var $image_resize;
  441. /**
  442. * Set this variable to convert the file if it is an image
  443. *
  444. * Possibles values are : ''; 'png'; 'jpeg'; 'gif'; 'bmp'
  445. *
  446. * Default value is '' (no conversion)<br>
  447. * If {@link resize} is true, {@link convert} will be set to the source file extension
  448. *
  449. * @access public
  450. * @var string
  451. */
  452. var $image_convert;
  453. /**
  454. * Set this variable to the wanted (or maximum/minimum) width for the processed image, in pixels
  455. *
  456. * Default value is 150
  457. *
  458. * @access public
  459. * @var integer
  460. */
  461. var $image_x;
  462. /**
  463. * Set this variable to the wanted (or maximum/minimum) height for the processed image, in pixels
  464. *
  465. * Default value is 150
  466. *
  467. * @access public
  468. * @var integer
  469. */
  470. var $image_y;
  471. /**
  472. * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
  473. *
  474. * Default value is false
  475. *
  476. * @access public
  477. * @var bool
  478. */
  479. var $image_ratio;
  480. /**
  481. * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
  482. *
  483. * The image will be resized as to fill the whole space, and excedent will be cropped
  484. *
  485. * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right)
  486. * If set as a string, it determines which side of the image is kept while cropping.
  487. * By default, the part of the image kept is in the center, i.e. it crops equally on both sides
  488. *
  489. * Default value is false
  490. *
  491. * @access public
  492. * @var mixed
  493. */
  494. var $image_ratio_crop;
  495. /**
  496. * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
  497. *
  498. * The image will be resized to fit entirely in the space, and the rest will be colored.
  499. * The default color is white, but can be set with {@link image_default_color}
  500. *
  501. * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right)
  502. * If set as a string, it determines in which side of the space the image is displayed.
  503. * By default, the image is displayed in the center, i.e. it fills the remaining space equally on both sides
  504. *
  505. * Default value is false
  506. *
  507. * @access public
  508. * @var mixed
  509. */
  510. var $image_ratio_fill;
  511. /**
  512. * Set this variable to a number of pixels so that {@link image_x} and {@link image_y} are the best match possible
  513. *
  514. * The image will be resized to have approximatively the number of pixels
  515. * The aspect ratio wil be conserved
  516. *
  517. * Default value is false
  518. *
  519. * @access public
  520. * @var mixed
  521. */
  522. var $image_ratio_pixels;
  523. /**
  524. * Set this variable to calculate {@link image_x} automatically , using {@link image_y} and conserving ratio
  525. *
  526. * Default value is false
  527. *
  528. * @access public
  529. * @var bool
  530. */
  531. var $image_ratio_x;
  532. /**
  533. * Set this variable to calculate {@link image_y} automatically , using {@link image_x} and conserving ratio
  534. *
  535. * Default value is false
  536. *
  537. * @access public
  538. * @var bool
  539. */
  540. var $image_ratio_y;
  541. /**
  542. * (deprecated) Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y},
  543. * but only if original image is bigger
  544. *
  545. * This setting is soon to be deprecated. Instead, use {@link image_ratio} and {@link image_no_enlarging}
  546. *
  547. * Default value is false
  548. *
  549. * @access public
  550. * @var bool
  551. */
  552. var $image_ratio_no_zoom_in;
  553. /**
  554. * (deprecated) Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y},
  555. * but only if original image is smaller
  556. *
  557. * Default value is false
  558. *
  559. * This setting is soon to be deprecated. Instead, use {@link image_ratio} and {@link image_no_shrinking}
  560. *
  561. * @access public
  562. * @var bool
  563. */
  564. var $image_ratio_no_zoom_out;
  565. /**
  566. * Cancel resizing if the resized image is bigger than the original image, to prevent enlarging
  567. *
  568. * Default value is false
  569. *
  570. * @access public
  571. * @var bool
  572. */
  573. var $image_no_enlarging;
  574. /**
  575. * Cancel resizing if the resized image is smaller than the original image, to prevent shrinking
  576. *
  577. * Default value is false
  578. *
  579. * @access public
  580. * @var bool
  581. */
  582. var $image_no_shrinking;
  583. /**
  584. * Set this variable to set a maximum image width, above which the upload will be invalid
  585. *
  586. * Default value is null
  587. *
  588. * @access public
  589. * @var integer
  590. */
  591. var $image_max_width;
  592. /**
  593. * Set this variable to set a maximum image height, above which the upload will be invalid
  594. *
  595. * Default value is null
  596. *
  597. * @access public
  598. * @var integer
  599. */
  600. var $image_max_height;
  601. /**
  602. * Set this variable to set a maximum number of pixels for an image, above which the upload will be invalid
  603. *
  604. * Default value is null
  605. *
  606. * @access public
  607. * @var long
  608. */
  609. var $image_max_pixels;
  610. /**
  611. * Set this variable to set a maximum image aspect ratio, above which the upload will be invalid
  612. *
  613. * Note that ratio = width / height
  614. *
  615. * Default value is null
  616. *
  617. * @access public
  618. * @var float
  619. */
  620. var $image_max_ratio;
  621. /**
  622. * Set this variable to set a minimum image width, below which the upload will be invalid
  623. *
  624. * Default value is null
  625. *
  626. * @access public
  627. * @var integer
  628. */
  629. var $image_min_width;
  630. /**
  631. * Set this variable to set a minimum image height, below which the upload will be invalid
  632. *
  633. * Default value is null
  634. *
  635. * @access public
  636. * @var integer
  637. */
  638. var $image_min_height;
  639. /**
  640. * Set this variable to set a minimum number of pixels for an image, below which the upload will be invalid
  641. *
  642. * Default value is null
  643. *
  644. * @access public
  645. * @var long
  646. */
  647. var $image_min_pixels;
  648. /**
  649. * Set this variable to set a minimum image aspect ratio, below which the upload will be invalid
  650. *
  651. * Note that ratio = width / height
  652. *
  653. * Default value is null
  654. *
  655. * @access public
  656. * @var float
  657. */
  658. var $image_min_ratio;
  659. /**
  660. * Compression level for PNG images
  661. *
  662. * Between 1 (fast but large files) and 9 (slow but smaller files)
  663. *
  664. * Default value is null (Zlib default)
  665. *
  666. * @access public
  667. * @var integer
  668. */
  669. var $png_compression;
  670. /**
  671. * Quality of JPEG created/converted destination image
  672. *
  673. * Default value is 85
  674. *
  675. * @access public
  676. * @var integer
  677. */
  678. var $jpeg_quality;
  679. /**
  680. * Determines the quality of the JPG image to fit a desired file size
  681. *
  682. * The JPG quality will be set between 1 and 100%
  683. * The calculations are approximations.
  684. *
  685. * Value in bytes (integer) or shorthand byte values (string) is allowed.
  686. * The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes)
  687. *
  688. * Default value is null (no calculations)
  689. *
  690. * @access public
  691. * @var integer
  692. */
  693. var $jpeg_size;
  694. /**
  695. * Turns the interlace bit on
  696. *
  697. * This is actually used only for JPEG images, and defaults to false
  698. *
  699. * @access public
  700. * @var boolean
  701. */
  702. var $image_interlace;
  703. /**
  704. * Flag set to true when the image is transparent
  705. *
  706. * This is actually used only for transparent GIFs
  707. *
  708. * @access public
  709. * @var boolean
  710. */
  711. var $image_is_transparent;
  712. /**
  713. * Transparent color in a palette
  714. *
  715. * This is actually used only for transparent GIFs
  716. *
  717. * @access public
  718. * @var boolean
  719. */
  720. var $image_transparent_color;
  721. /**
  722. * Background color, used to paint transparent areas with
  723. *
  724. * If set, it will forcibly remove transparency by painting transparent areas with the color
  725. * This setting will fill in all transparent areas in PNG and GIF, as opposed to {@link image_default_color}
  726. * which will do so only in BMP, JPEG, and alpha transparent areas in transparent GIFs
  727. * This setting overrides {@link image_default_color}
  728. *
  729. * Default value is null
  730. *
  731. * @access public
  732. * @var string
  733. */
  734. var $image_background_color;
  735. /**
  736. * Default color for non alpha-transparent images
  737. *
  738. * This setting is to be used to define a background color for semi transparent areas
  739. * of an alpha transparent when the output format doesn't support alpha transparency
  740. * This is useful when, from an alpha transparent PNG image, or an image with alpha transparent features
  741. * if you want to output it as a transparent GIFs for instance, you can set a blending color for transparent areas
  742. * If you output in JPEG or BMP, this color will be used to fill in the previously transparent areas
  743. *
  744. * The default color white
  745. *
  746. * @access public
  747. * @var boolean
  748. */
  749. var $image_default_color;
  750. /**
  751. * Flag set to true when the image is not true color
  752. *
  753. * @access public
  754. * @var boolean
  755. */
  756. var $image_is_palette;
  757. /**
  758. * Corrects the image brightness
  759. *
  760. * Value can range between -127 and 127
  761. *
  762. * Default value is null
  763. *
  764. * @access public
  765. * @var integer
  766. */
  767. var $image_brightness;
  768. /**
  769. * Corrects the image contrast
  770. *
  771. * Value can range between -127 and 127
  772. *
  773. * Default value is null
  774. *
  775. * @access public
  776. * @var integer
  777. */
  778. var $image_contrast;
  779. /**
  780. * Changes the image opacity
  781. *
  782. * Value can range between 0 and 100
  783. *
  784. * Default value is null
  785. *
  786. * @access public
  787. * @var integer
  788. */
  789. var $image_opacity;
  790. /**
  791. * Applies threshold filter
  792. *
  793. * Value can range between -127 and 127
  794. *
  795. * Default value is null
  796. *
  797. * @access public
  798. * @var integer
  799. */
  800. var $image_threshold;
  801. /**
  802. * Applies a tint on the image
  803. *
  804. * Value is an hexadecimal color, such as #FFFFFF
  805. *
  806. * Default value is null
  807. *
  808. * @access public
  809. * @var string;
  810. */
  811. var $image_tint_color;
  812. /**
  813. * Applies a colored overlay on the image
  814. *
  815. * Value is an hexadecimal color, such as #FFFFFF
  816. *
  817. * To use with {@link image_overlay_opacity}
  818. *
  819. * Default value is null
  820. *
  821. * @access public
  822. * @var string;
  823. */
  824. var $image_overlay_color;
  825. /**
  826. * Sets the opacity for the colored overlay
  827. *
  828. * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
  829. *
  830. * Unless used with {@link image_overlay_color}, this setting has no effect
  831. *
  832. * Default value is 50
  833. *
  834. * @access public
  835. * @var integer
  836. */
  837. var $image_overlay_opacity;
  838. /**
  839. * Inverts the color of an image
  840. *
  841. * Default value is FALSE
  842. *
  843. * @access public
  844. * @var boolean;
  845. */
  846. var $image_negative;
  847. /**
  848. * Turns the image into greyscale
  849. *
  850. * Default value is FALSE
  851. *
  852. * @access public
  853. * @var boolean;
  854. */
  855. var $image_greyscale;
  856. /**
  857. * Pixelate an image
  858. *
  859. * Value is integer, represents the block size
  860. *
  861. * Default value is null
  862. *
  863. * @access public
  864. * @var integer;
  865. */
  866. var $image_pixelate;
  867. /**
  868. * Applies an unsharp mask, with alpha transparency support
  869. *
  870. * Beware that this unsharp mask is quite resource-intensive
  871. *
  872. * Default value is FALSE
  873. *
  874. * @access public
  875. * @var boolean;
  876. */
  877. var $image_unsharp;
  878. /**
  879. * Sets the unsharp mask amount
  880. *
  881. * Value is an integer between 0 and 500, typically between 50 and 200
  882. *
  883. * Unless used with {@link image_unsharp}, this setting has no effect
  884. *
  885. * Default value is 80
  886. *
  887. * @access public
  888. * @var integer
  889. */
  890. var $image_unsharp_amount;
  891. /**
  892. * Sets the unsharp mask radius
  893. *
  894. * Value is an integer between 0 and 50, typically between 0.5 and 1
  895. * It is not recommended to change it, the default works best
  896. *
  897. * Unless used with {@link image_unsharp}, this setting has no effect
  898. *
  899. * From PHP 5.1, imageconvolution is used, and this setting has no effect
  900. *
  901. * Default value is 0.5
  902. *
  903. * @access public
  904. * @var integer
  905. */
  906. var $image_unsharp_radius;
  907. /**
  908. * Sets the unsharp mask threshold
  909. *
  910. * Value is an integer between 0 and 255, typically between 0 and 5
  911. *
  912. * Unless used with {@link image_unsharp}, this setting has no effect
  913. *
  914. * Default value is 1
  915. *
  916. * @access public
  917. * @var integer
  918. */
  919. var $image_unsharp_threshold;
  920. /**
  921. * Adds a text label on the image
  922. *
  923. * Value is a string, any text. Text will not word-wrap, although you can use breaklines in your text "\n"
  924. *
  925. * If set, this setting allow the use of all other settings starting with image_text_
  926. *
  927. * Replacement tokens can be used in the string:
  928. * <pre>
  929. * gd_version src_name src_name_body src_name_ext
  930. * src_pathname src_mime src_x src_y
  931. * src_type src_bits src_pixels
  932. * src_size src_size_kb src_size_mb src_size_human
  933. * dst_path dst_name_body dst_pathname
  934. * dst_name dst_name_ext dst_x dst_y
  935. * date time host server ip
  936. * </pre>
  937. * The tokens must be enclosed in square brackets: [dst_x] will be replaced by the width of the picture
  938. *
  939. * Default value is null
  940. *
  941. * @access public
  942. * @var string;
  943. */
  944. var $image_text;
  945. /**
  946. * Sets the text direction for the text label
  947. *
  948. * Value is either 'h' or 'v', as in horizontal and vertical
  949. *
  950. * Note that if you use a TrueType font, you can use {@link image_text_angle} instead
  951. *
  952. * Default value is h (horizontal)
  953. *
  954. * @access public
  955. * @var string;
  956. */
  957. var $image_text_direction;
  958. /**
  959. * Sets the text color for the text label
  960. *
  961. * Value is an hexadecimal color, such as #FFFFFF
  962. *
  963. * Default value is #FFFFFF (white)
  964. *
  965. * @access public
  966. * @var string;
  967. */
  968. var $image_text_color;
  969. /**
  970. * Sets the text opacity in the text label
  971. *
  972. * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
  973. *
  974. * Default value is 100
  975. *
  976. * @access public
  977. * @var integer
  978. */
  979. var $image_text_opacity;
  980. /**
  981. * Sets the text background color for the text label
  982. *
  983. * Value is an hexadecimal color, such as #FFFFFF
  984. *
  985. * Default value is null (no background)
  986. *
  987. * @access public
  988. * @var string;
  989. */
  990. var $image_text_background;
  991. /**
  992. * Sets the text background opacity in the text label
  993. *
  994. * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
  995. *
  996. * Default value is 100
  997. *
  998. * @access public
  999. * @var integer
  1000. */
  1001. var $image_text_background_opacity;
  1002. /**
  1003. * Sets the text font in the text label
  1004. *
  1005. * Value is a an integer between 1 and 5 for GD built-in fonts. 1 is the smallest font, 5 the biggest
  1006. * Value can also be a string, which represents the path to a GDF or TTF font (TrueType).
  1007. *
  1008. * Default value is 5
  1009. *
  1010. * @access public
  1011. * @var mixed;
  1012. */
  1013. var $image_text_font;
  1014. /**
  1015. * Sets the text font size for TrueType fonts
  1016. *
  1017. * Value is a an integer, and represents the font size in pixels (GD1) or points (GD1)
  1018. *
  1019. * Note that this setting is only applicable to TrueType fonts, and has no effects with GD fonts
  1020. *
  1021. * Default value is 16
  1022. *
  1023. * @access public
  1024. * @var integer;
  1025. */
  1026. var $image_text_size;
  1027. /**
  1028. * Sets the text angle for TrueType fonts
  1029. *
  1030. * Value is a an integer between 0 and 360, in degrees, with 0 degrees being left-to-right reading text.
  1031. *
  1032. * Note that this setting is only applicable to TrueType fonts, and has no effects with GD fonts
  1033. * For GD fonts, you can use {@link image_text_direction} instead
  1034. *
  1035. * Default value is null (so it is determined by the value of {@link image_text_direction})
  1036. *
  1037. * @access public
  1038. * @var integer;
  1039. */
  1040. var $image_text_angle;
  1041. /**
  1042. * Sets the text label position within the image
  1043. *
  1044. * Value is one or two out of 'TBLR' (top, bottom, left, right)
  1045. *
  1046. * The positions are as following:
  1047. * <pre>
  1048. * TL T TR
  1049. * L R
  1050. * BL B BR
  1051. * </pre>
  1052. *
  1053. * Default value is null (centered, horizontal and vertical)
  1054. *
  1055. * Note that is {@link image_text_x} and {@link image_text_y} are used, this setting has no effect
  1056. *
  1057. * @access public
  1058. * @var string;
  1059. */
  1060. var $image_text_position;
  1061. /**
  1062. * Sets the text label absolute X position within the image
  1063. *
  1064. * Value is in pixels, representing the distance between the left of the image and the label
  1065. * If a negative value is used, it will represent the distance between the right of the image and the label
  1066. *
  1067. * Default value is null (so {@link image_text_position} is used)
  1068. *
  1069. * @access public
  1070. * @var integer
  1071. */
  1072. var $image_text_x;
  1073. /**
  1074. * Sets the text label absolute Y position within the image
  1075. *
  1076. * Value is in pixels, representing the distance between the top of the image and the label
  1077. * If a negative value is used, it will represent the distance between the bottom of the image and the label
  1078. *
  1079. * Default value is null (so {@link image_text_position} is used)
  1080. *
  1081. * @access public
  1082. * @var integer
  1083. */
  1084. var $image_text_y;
  1085. /**
  1086. * Sets the text label padding
  1087. *
  1088. * Value is in pixels, representing the distance between the text and the label background border
  1089. *
  1090. * Default value is 0
  1091. *
  1092. * This setting can be overriden by {@link image_text_padding_x} and {@link image_text_padding_y}
  1093. *
  1094. * @access public
  1095. * @var integer
  1096. */
  1097. var $image_text_padding;
  1098. /**
  1099. * Sets the text label horizontal padding
  1100. *
  1101. * Value is in pixels, representing the distance between the text and the left and right label background borders
  1102. *
  1103. * Default value is null
  1104. *
  1105. * If set, this setting overrides the horizontal part of {@link image_text_padding}
  1106. *
  1107. * @access public
  1108. * @var integer
  1109. */
  1110. var $image_text_padding_x;
  1111. /**
  1112. * Sets the text label vertical padding
  1113. *
  1114. * Value is in pixels, representing the distance between the text and the top and bottom label background borders
  1115. *
  1116. * Default value is null
  1117. *
  1118. * If set, his setting overrides the vertical part of {@link image_text_padding}
  1119. *
  1120. * @access public
  1121. * @var integer
  1122. */
  1123. var $image_text_padding_y;
  1124. /**
  1125. * Sets the text alignment
  1126. *
  1127. * Value is a string, which can be either 'L', 'C' or 'R'
  1128. *
  1129. * Default value is 'C'
  1130. *
  1131. * This setting is relevant only if the text has several lines.
  1132. *
  1133. * Note that this setting is only applicable to GD fonts, and has no effects with TrueType fonts
  1134. *
  1135. * @access public
  1136. * @var string;
  1137. */
  1138. var $image_text_alignment;
  1139. /**
  1140. * Sets the text line spacing
  1141. *
  1142. * Value is an integer, in pixels
  1143. *
  1144. * Default value is 0
  1145. *
  1146. * This setting is relevant only if the text has several lines.
  1147. *
  1148. * Note that this setting is only applicable to GD fonts, and has no effects with TrueType fonts
  1149. *
  1150. * @access public
  1151. * @var integer
  1152. */
  1153. var $image_text_line_spacing;
  1154. /**
  1155. * Sets the height of the reflection
  1156. *
  1157. * Value is an integer in pixels, or a string which format can be in pixels or percentage.
  1158. * For instance, values can be : 40, '40', '40px' or '40%'
  1159. *
  1160. * Default value is null, no reflection
  1161. *
  1162. * @access public
  1163. * @var mixed;
  1164. */
  1165. var $image_reflection_height;
  1166. /**
  1167. * Sets the space between the source image and its relection
  1168. *
  1169. * Value is an integer in pixels, which can be negative
  1170. *
  1171. * Default value is 2
  1172. *
  1173. * This setting is relevant only if {@link image_reflection_height} is set
  1174. *
  1175. * @access public
  1176. * @var integer
  1177. */
  1178. var $image_reflection_space;
  1179. /**
  1180. * Sets the initial opacity of the reflection
  1181. *
  1182. * Value is an integer between 0 (no opacity) and 100 (full opacity).
  1183. * The reflection will start from {@link image_reflection_opacity} and end up at 0
  1184. *
  1185. * Default value is 60
  1186. *
  1187. * This setting is relevant only if {@link image_reflection_height} is set
  1188. *
  1189. * @access public
  1190. * @var integer
  1191. */
  1192. var $image_reflection_opacity;
  1193. /**
  1194. * Automatically rotates the image according to EXIF data (JPEG only)
  1195. *
  1196. * Default value is true
  1197. *
  1198. * @access public
  1199. * @var boolean;
  1200. */
  1201. var $image_auto_rotate;
  1202. /**
  1203. * Flips the image vertically or horizontally
  1204. *
  1205. * Value is either 'h' or 'v', as in horizontal and vertical
  1206. *
  1207. * Default value is null (no flip)
  1208. *
  1209. * @access public
  1210. * @var string;
  1211. */
  1212. var $image_flip;
  1213. /**
  1214. * Rotates the image by increments of 45 degrees
  1215. *
  1216. * Value is either 90, 180 or 270
  1217. *
  1218. * Default value is null (no rotation)
  1219. *
  1220. * @access public
  1221. * @var string;
  1222. */
  1223. var $image_rotate;
  1224. /**
  1225. * Crops an image
  1226. *
  1227. * Values are four dimensions, or two, or one (CSS style)
  1228. * They represent the amount cropped top, right, bottom and left.
  1229. * These values can either be in an array, or a space separated string.
  1230. * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
  1231. *
  1232. * For instance, are valid:
  1233. * <pre>
  1234. * $foo->image_crop = 20 OR array(20);
  1235. * $foo->image_crop = '20px' OR array('20px');
  1236. * $foo->image_crop = '20 40' OR array('20', 40);
  1237. * $foo->image_crop = '-20 25%' OR array(-20, '25%');
  1238. * $foo->image_crop = '20px 25%' OR array('20px', '25%');
  1239. * $foo->image_crop = '20% 25%' OR array('20%', '25%');
  1240. * $foo->image_crop = '20% 25% 10% 30%' OR array('20%', '25%', '10%', '30%');
  1241. * $foo->image_crop = '20px 25px 2px 2px' OR array('20px', '25%px', '2px', '2px');
  1242. * $foo->image_crop = '20 25% 40px 10%' OR array(20, '25%', '40px', '10%');
  1243. * </pre>
  1244. *
  1245. * If a value is negative, the image will be expanded, and the extra parts will be filled with black
  1246. *
  1247. * Default value is null (no cropping)
  1248. *
  1249. * @access public
  1250. * @var string OR array;
  1251. */
  1252. var $image_crop;
  1253. /**
  1254. * Crops an image, before an eventual resizing
  1255. *
  1256. * See {@link image_crop} for valid formats
  1257. *
  1258. * Default value is null (no cropping)
  1259. *
  1260. * @access public
  1261. * @var string OR array;
  1262. */
  1263. var $image_precrop;
  1264. /**
  1265. * Adds a bevel border on the image
  1266. *
  1267. * Value is a positive integer, representing the thickness of the bevel
  1268. *
  1269. * If the bevel colors are the same as the background, it makes a fade out effect
  1270. *
  1271. * Default value is null (no bevel)
  1272. *
  1273. * @access public
  1274. * @var integer
  1275. */
  1276. var $image_bevel;
  1277. /**
  1278. * Top and left bevel color
  1279. *
  1280. * Value is a color, in hexadecimal format
  1281. * This setting is used only if {@link image_bevel} is set
  1282. *
  1283. * Default value is #FFFFFF
  1284. *
  1285. * @access public
  1286. * @var string;
  1287. */
  1288. var $image_bevel_color1;
  1289. /**
  1290. * Right and bottom bevel color
  1291. *
  1292. * Value is a color, in hexadecimal format
  1293. * This setting is used only if {@link image_bevel} is set
  1294. *
  1295. * Default value is #000000
  1296. *
  1297. * @access public
  1298. * @var string;
  1299. */
  1300. var $image_bevel_color2;
  1301. /**
  1302. * Adds a single-color border on the outer of the image
  1303. *
  1304. * Values are four dimensions, or two, or one (CSS style)
  1305. * They represent the border thickness top, right, bottom and left.
  1306. * These values can either be in an array, or a space separated string.
  1307. * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
  1308. *
  1309. * See {@link image_crop} for valid formats
  1310. *
  1311. * If a value is negative, the image will be cropped.
  1312. * Note that the dimensions of the picture will be increased by the borders' thickness
  1313. *
  1314. * Default value is null (no border)
  1315. *
  1316. * @access public
  1317. * @var integer
  1318. */
  1319. var $image_border;
  1320. /**
  1321. * Border color
  1322. *
  1323. * Value is a color, in hexadecimal format.
  1324. * This setting is used only if {@link image_border} is set
  1325. *
  1326. * Default value is #FFFFFF
  1327. *
  1328. * @access public
  1329. * @var string;
  1330. */
  1331. var $image_border_color;
  1332. /**
  1333. * Sets the opacity for the borders
  1334. *
  1335. * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
  1336. *
  1337. * Unless used with {@link image_border}, this setting has no effect
  1338. *
  1339. * Default value is 100
  1340. *
  1341. * @access public
  1342. * @var integer
  1343. */
  1344. var $image_border_opacity;
  1345. /**
  1346. * Adds a fading-to-transparent border on the image
  1347. *
  1348. * Values are four dimensions, or two, or one (CSS style)
  1349. * They represent the border thickness top, right, bottom and left.
  1350. * These values can either be in an array, or a space separated string.
  1351. * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
  1352. *
  1353. * See {@link image_crop} for valid formats
  1354. *
  1355. * Note that the dimensions of the picture will not be increased by the borders' thickness
  1356. *
  1357. * Default value is null (no border)
  1358. *
  1359. * @access public
  1360. * @var integer
  1361. */
  1362. var $image_border_transparent;
  1363. /**
  1364. * Adds a multi-color frame on the outer of the image
  1365. *
  1366. * Value is an integer. Two values are possible for now:
  1367. * 1 for flat border, meaning that the frame is mirrored horizontally and vertically
  1368. * 2 for crossed border, meaning that the frame will be inversed, as in a bevel effect
  1369. *
  1370. * The frame will be composed of colored lines set in {@link image_frame_colors}
  1371. *
  1372. * Note that the dimensions of the picture will be increased by the borders' thickness
  1373. *
  1374. * Default value is null (no frame)
  1375. *
  1376. * @access public
  1377. * @var integer
  1378. */
  1379. var $image_frame;
  1380. /**
  1381. * Sets the colors used to draw a frame
  1382. *
  1383. * Values is a list of n colors in hexadecimal format.
  1384. * These values can either be in an array, or a space separated string.
  1385. *
  1386. * The colors are listed in the following order: from the outset of the image to its center
  1387. *
  1388. * For instance, are valid:
  1389. * <pre>
  1390. * $foo->image_frame_colors = '#FFFFFF #999999 #666666 #000000';
  1391. * $foo->image_frame_colors = array('#FFFFFF', '#999999', '#666666', '#000000');
  1392. * </pre>
  1393. *
  1394. * This setting is used only if {@link image_frame} is set
  1395. *
  1396. * Default value is '#FFFFFF #999999 #666666 #000000'
  1397. *
  1398. * @access public
  1399. * @var string OR array;
  1400. */
  1401. var $image_frame_colors;
  1402. /**
  1403. * Sets the opacity for the frame
  1404. *
  1405. * Value is a percentage, as an integer between 0 (transparent) and 100 (opaque)
  1406. *
  1407. * Unless used with {@link image_frame}, this setting has no effect
  1408. *
  1409. * Default value is 100
  1410. *
  1411. * @access public
  1412. * @var integer
  1413. */
  1414. var $image_frame_opacity;
  1415. /**
  1416. * Adds a watermark on the image
  1417. *
  1418. * Value is a local image filename, relative or absolute. GIF, JPG, BMP and PNG are supported, as well as PNG alpha.
  1419. *
  1420. * If set, this setting allow the use of all other settings starting with image_watermark_
  1421. *
  1422. * Default value is null
  1423. *
  1424. * @access public
  1425. * @var string;
  1426. */
  1427. var $image_watermark;
  1428. /**
  1429. * Sets the watermarkposition within the image
  1430. *
  1431. * Value is one or two out of 'TBLR' (top, bottom, left, right)
  1432. *
  1433. * The positions are as following: TL T TR
  1434. * L R
  1435. * BL B BR
  1436. *
  1437. * Default value is null (centered, horizontal and vertical)
  1438. *
  1439. * Note that is {@link image_watermark_x} and {@link image_watermark_y} are used, this setting has no effect
  1440. *
  1441. * @access public
  1442. * @var string;
  1443. */
  1444. var $image_watermark_position;
  1445. /**
  1446. * Sets the watermark absolute X position within the image
  1447. *
  1448. * Value is in pixels, representing the distance between the top of the image and the watermark
  1449. * If a negative value is used, it will represent the distance between the bottom of the image and the watermark
  1450. *
  1451. * Default value is null (so {@link image_watermark_position} is used)
  1452. *
  1453. * @access public
  1454. * @var integer
  1455. */
  1456. var $image_watermark_x;
  1457. /**
  1458. * Sets the twatermark absolute Y position within the image
  1459. *
  1460. * Value is in pixels, representing the distance between the left of the image and the watermark
  1461. * If a negative value is used, it will represent the distance between the right of the image and the watermark
  1462. *
  1463. * Default value is null (so {@link image_watermark_position} is used)
  1464. *
  1465. * @access public
  1466. * @var integer
  1467. */
  1468. var $image_watermark_y;
  1469. /**
  1470. * Prevents the watermark to be resized up if it is smaller than the image
  1471. *
  1472. * If the watermark if smaller than the destination image, taking in account the desired watermark position
  1473. * then it will be resized up to fill in the image (minus the {@link image_watermark_x} or {@link image_watermark_y} values)
  1474. *
  1475. * If you don't want your watermark to be resized in any way, then
  1476. * set {@link image_watermark_no_zoom_in} and {@link image_watermark_no_zoom_out} to true
  1477. * If you want your watermark to be resized up or doan to fill in the image better, then
  1478. * set {@link image_watermark_no_zoom_in} and {@link image_watermark_no_zoom_out} to false
  1479. *
  1480. * Default value is true (so the watermark will not be resized up, which is the behaviour most people expect)
  1481. *
  1482. * @access public
  1483. * @var integer
  1484. */
  1485. var $image_watermark_no_zoom_in;
  1486. /**
  1487. * Prevents the watermark to be resized down if it is bigger than the image
  1488. *
  1489. * If the watermark if bigger than the destination image, taking in account the desired watermark position
  1490. * then it will be resized down to fit in the image (minus the {@link image_watermark_x} or {@link image_watermark_y} values)
  1491. *
  1492. * If you don't want your watermark to be resized in any way, then
  1493. * set {@link image_watermark_no_zoom_in} and {@link image_watermark_no_zoom_out} to true
  1494. * If you want your watermark to be resized up or doan to fill in the image better, then
  1495. * set {@link image_watermark_no_zoom_in} and {@link image_watermark_no_zoom_out} to false
  1496. *
  1497. * Default value is false (so the watermark may be shrinked to fit in the image)
  1498. *
  1499. * @access public
  1500. * @var integer
  1501. */
  1502. var $image_watermark_no_zoom_out;
  1503. /**
  1504. * List of MIME types per extension
  1505. *
  1506. * @access private
  1507. * @var array
  1508. */
  1509. var $mime_types;
  1510. /**
  1511. * Allowed MIME types
  1512. *
  1513. * Default is a selection of safe mime-types, but you might want to change it
  1514. *
  1515. * Simple wildcards are allowed, such as image/* or application/*
  1516. * If there is only one MIME type allowed, then it can be a string instead of an array
  1517. *
  1518. * @access public
  1519. * @var array OR string
  1520. */
  1521. var $allowed;
  1522. /**
  1523. * Forbidden MIME types
  1524. *
  1525. * Default is a selection of safe mime-types, but you might want to change it
  1526. * To only check for forbidden MIME types, and allow everything else, set {@link allowed} to array('* / *') without the spaces
  1527. *
  1528. * Simple wildcards are allowed, such as image/* or application/*
  1529. * If there is only one MIME type forbidden, then it can be a string instead of an array
  1530. *
  1531. * @access public
  1532. * @var array OR string
  1533. */
  1534. var $forbidden;
  1535. /**
  1536. * Array of translated error messages
  1537. *
  1538. * By default, the language is english (en_GB)
  1539. * Translations can be in separate files, in a lang/ subdirectory
  1540. *
  1541. * @access public
  1542. * @var array
  1543. */
  1544. var $translation;
  1545. /**
  1546. * Language selected for the translations
  1547. *
  1548. * By default, the language is english ("en_GB")
  1549. *
  1550. * @access public
  1551. * @var array
  1552. */
  1553. var $lang;
  1554. /**
  1555. * Init or re-init all the processing variables to their default values
  1556. *
  1557. * This function is called in the constructor, and after each call of {@link process}
  1558. *
  1559. * @access private
  1560. */
  1561. function init() {
  1562. // overiddable variables
  1563. $this->file_new_name_body = null; // replace the name body
  1564. $this->file_name_body_add = null; // append to the name body
  1565. $this->file_name_body_pre = null; // prepend to the name body
  1566. $this->file_new_name_ext = null; // replace the file extension
  1567. $this->file_safe_name = true; // format safely the filename
  1568. $this->file_force_extension = true; // forces extension if there isn't one
  1569. $this->file_overwrite = false; // allows overwritting if the file already exists
  1570. $this->file_auto_rename = true; // auto-rename if the file already exists
  1571. $this->dir_auto_create = true; // auto-creates directory if missing
  1572. $this->dir_auto_chmod = true; // auto-chmod directory if not writeable
  1573. $this->dir_chmod = 0777; // default chmod to use
  1574. $this->no_script = true; // turns scripts into test files
  1575. $this->mime_check = true; // checks the mime type against the allowed list
  1576. // these are the different MIME detection methods. if one of these method doesn't work on your
  1577. // system, you can deactivate it here; just set it to false
  1578. $this->mime_fileinfo = true; // MIME detection with Fileinfo PECL extension
  1579. $this->mime_file = true; // MIME detection with UNIX file() command
  1580. $this->mime_magic = true; // MIME detection with mime_magic (mime_content_type())
  1581. $this->mime_getimagesize = true; // MIME detection with getimagesize()
  1582. // get the default max size from php.ini
  1583. $this->file_max_size_raw = trim(ini_get('upload_max_filesize'));
  1584. $this->file_max_size = $this->getsize($this->file_max_size_raw);
  1585. $this->image_resize = false; // resize the image
  1586. $this->image_convert = ''; // convert. values :''; 'png'; 'jpeg'; 'gif'; 'bmp'
  1587. $this->image_x = 150;
  1588. $this->image_y = 150;
  1589. $this->image_ratio = false; // keeps aspect ratio with x and y dimensions
  1590. $this->image_ratio_crop = false; // keeps aspect ratio with x and y dimensions, filling the space
  1591. $this->image_ratio_fill = false; // keeps aspect ratio with x and y dimensions, fitting the image in the space, and coloring the rest
  1592. $this->image_ratio_pixels = false; // keeps aspect ratio, calculating x and y so that the image is approx the set number of pixels
  1593. $this->image_ratio_x = false; // calculate the $image_x if true
  1594. $this->image_ratio_y = false; // calculate the $image_y if true
  1595. $this->image_ratio_no_zoom_in = false;
  1596. $this->image_ratio_no_zoom_out = false;
  1597. $this->image_no_enlarging = false;
  1598. $this->image_no_shrinking = false;
  1599. $this->png_compression = null;
  1600. $this->jpeg_quality = 85;
  1601. $this->jpeg_size = null;
  1602. $this->image_interlace = false;
  1603. $this->image_is_transparent = false;
  1604. $this->image_transparent_color = null;
  1605. $this->image_background_color = null;
  1606. $this->image_default_color = '#ffffff';
  1607. $this->image_is_palette = false;
  1608. $this->image_max_width = null;
  1609. $this->image_max_height = null;
  1610. $this->image_max_pixels = null;
  1611. $this->image_max_ratio = null;
  1612. $this->image_min_width = null;
  1613. $this->image_min_height = null;
  1614. $this->image_min_pixels = null;
  1615. $this->image_min_ratio = null;
  1616. $this->image_brightness = null;
  1617. $this->image_contrast = null;
  1618. $this->image_opacity = null;
  1619. $this->image_threshold = null;
  1620. $this->image_tint_color = null;
  1621. $this->image_overlay_color = null;
  1622. $this->image_overlay_opacity = null;

Large files files are truncated, but you can click here to view the full file