1//////////////////////////////////////////////////////////////////
2//   phpThumb() by James Heinrich <info@silisoftware.com>       //
3//        available at http://phpthumb.sourceforge.net          //
4//             and/or https://github.com/JamesHeinrich/phpThumb //
5//////////////////////////////////////////////////////////////////
6///                                                             //
7//       This code is released under the GNU GPL:               //
8//         http://www.gnu.org/copyleft/gpl.html                 //
9//                                                              //
10// phpThumb() is free to use according to the terms of the GPL. //
11// GPL FAQ: http://gnu.org/licenses/gpl-faq.html                //
12//                                                              //
13// Donations are gratefully accepted from happy users :)        //
14// See http://phpthumb.sourceforge.net                          //
15//                                                             ///
16//////////////////////////////////////////////////////////////////
17
18============
19Description:
20============
21
22phpThumb() uses the GD library to create thumbnails from images (GIF, PNG
23or JPEG) on the fly. The output size is configurable (can be larger or
24smaller than the source), and the source may be the entire image or only a
25portion of the original image. True color and resampling is used if
26GD v2.0+ is available, otherwise low-color and simple resizing is used.
27Source image can be a physical file on the server or can be retrieved from
28a database. GIFs are supported on all versions of GD even if GD does not
29have native GIF support thanks to the GIFutil class by Fabien Ezber.
30
31AntiHotlinking feature prevents other people from using your server to
32resize their thumbnails, or link to your images from another server. The
33cache feature reduces server load.
34
35
36========
37Support:
38========
39First, read this file.
40Then read phpthumb.faq.txt
41Then run /demo/phpThumb.demo.check.php
42If you still think it's a bug, or can't figure it out, please go to
43http://support.silisoftware.com
44
45
46=============
47Installation:
48=============
49
501) Download from either official site:
51  * https://github.com/JamesHeinrich/phpThumb (current development version)
52  * http://phpthumb.sourceforge.net (occasional releases + documentation)
532) unzip to a location of your choice on your server, putting it in its
54  own subdirectory (e.g. /phpThumb/ is useful but not required)
553) rename phpThumb.config.php.default -> phpThumb.config.php
564) edit phpThumb.config.php as needed to suit your server configuration.
57  * the only setting you must set is 'high_security_password'
58  * most other values are auto-detected, but your particular server config
59    may necessitate setting other values such as 'document_root' or
60    'imagemagick_path'
61  * see also "Configuration" section below
625) Check your server configuration by opening
63   /phpThumb/demo/phpThumb.demo.check.php in your browser. Settings that are
64   highlighted green are good; yellow/orange/red may need to be adjusted.
65
66
67======
68Usage:
69======
70
71Call phpThumb() just like you would a normal image (i.e. as the SRC attribute
72of an IMG tag):
73   <img src="phpThumb.php?src=/image.jpg&w=100&hash=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
74To generate the hash value you must include the phpThumb.config.php file and use the
75phpThumbURL function to generate the URL including the hash value:
76  echo '<img src="'.htmlspecialchars(phpThumbURL('src=/images/pic.jpg&w=50', '/path/to/phpThumb.php')).'">';
77The hash is calculated with the 'high_security_password' config value, so you
78must generate a complex password value for that setting in phpThumb.config.php
79(once, when installing phpThumb).
80
81See the "demo" link on http://phpthumb.sourceforge.net for more usage examples.
82Parameters that can be passed are listed below under "URL Parameters".
83
84NOTE: It's recommended you use the local image filename
85wherever possible (rather than http://) because performance
86is much better, less (or no) use of temp files, and the
87last-modified check for cached files doesn't work for
88remote files.
89
90To access files over a LAN with Windows share names you
91must use the network name (or IP) and not a mapped drive
92name, for example:
93  //othercomputer/file.jpg - good
94  //192.168.2.1/file.jpg - good
95  z:/file.jpg - won't work
96This is a PHP limitation (see www.php.net/file-exists)
97Note: you may want to use "/" slashes instead of "\" if
98you have magic_quotes_gpc enabled to avoid stripslashes
99problems, although either slash should work if
100magic_quotes_gpc is disabled
101
102
103================================
104Alternate PATH_INFO-style Usage:
105================================
106
107phpThumb.php can also be called by passing parameters not
108after the usual "?" but like this:
109  phpThumb.php/<params>=<values>;<w>x<h>;<image>
110For example:
111  phpThumb.php/100;pic.jpg
112  phpThumb.php/100;images/pic.jpg
113  phpThumb.php/100;/images/pic.jpg
114  phpThumb.php/100x200;pic.jpg
115  phpThumb.php/x200;pic.jpg
116  phpThumb.php/f=jpeg;q=50;100x200;pic.jpg
117  phpThumb.php/fltr[]=usm;100;pic.jpg
118
119<image> must be the last item. Dimensions must be the second-
120last item. As many key/value pairs for parameters can be
121passed before those last two items, with each pair joined by
122equals ("=") and separated by semicolon (";")
123
124
125==============================================
126Calling as an object (not using phpThumb.php):
127==============================================
128
129NOTE: most people don't need to and should not do this. If you just want to
130display resized images, please just use phpThumb.php, not the object mode.
131To render output to one (or more) files instead of the browser, you should
132skip phpThumb.php and instantiate your own object. Please take a look at
133/demo/phpThumb.demo.object.php for details.
134
135Note: phpThumb.php is where the caching code is located, if you instantiate
136  your own phpThumb() object that code is bypassed and it's up to you to
137  handle the reading and writing of cached files.
138
139
140==============
141Configuration:
142==============
143
144There are some configuration options you may (but are not required to) change.
145Most configuration options can be set when you call phpThumb() - see list below),
146but default configuration options (such as cache directory) are in
147phpThumb.config.php - this is the only file you should ever modify.
148
149
150IMPORTANT:
151The configuration file is distributed as phpThumb.config.php.default to prevent
152accidental overwriting of old configuration settings. Please migrate your old
153settings to the new file (if upgrading), or delete your old config and rename
154the default to phpThumb.config.php since newer releases may include settings not
155present in your older configuration file.
156
157
158The configuration options you should maybe modify are:
159* high_security_password - required to generate the secure hashed URLs for
160  phpThumb using phpThumbURL() in phpThumb.config.php
161  Password must be sufficiently complex (typically means at least 20 mixed
162  alpha/numeric/punctuation characters). You can generate a good password
163  at http://www.silisoftware.com/tools/password-random.php
164* cache_directory - thumbnailing is slow and processor-intensive. Enabling
165  caching will dramatically speed up future thumbnail serving
166* imagemagick_path - Most image-processing functions can be processed faster
167  if ImageMagick is available on the server.
168* max_source_pixels - This should be auto-detected, but if auto-detection
169  fails and you get an invalid image from large source images, set this to
170  about 20% of your available PHP memory limit.
171  The amount of memory required for phpThumb depends on several factors:
172  * the dimensions of the source image
173  * the dimensions of the output image
174  * whether unsharp masking is applied
175  * whether watermarks are applied, etc.
176  The auto-detection of memory limits works as a general "safe" value. You
177  may be able to exceed the auto value by a small or large amount, depending
178  on whether you apply watermarks and/or sharpening, and the output size of
179  your thumbnails. If ImageMagick is available then the amount of available
180  PHP memory is usually not an issue.
181
182
183///////////////////////////////////////////////////////////////////////////
184Note: High-Security mode is VERY STRONGLY recommended enabled in all cases.
185Each call to phpThumb.php needs to be made through the function supplied
186at the bottom of phpThumb.config.php which create the hash:
187 require_once('phpThumb.config.php');
188 echo '<img src="'.phpThumbURL('src=pic.jpg&w=50', '/path/to/phpThumb.php').'">';
189///////////////////////////////////////////////////////////////////////////
190
191
192===========
193Parameters:
194===========
195
196 src = filename of source image
197 new = create new image, not thumbnail of existing image.
198       Requires "w" and "h" parameters set.
199       [ex: &new=FF0000|75] - red background, 75% opacity
200       Set to hex color string of background. Opacity is
201       optional (defaults to 100% opaque).
202   w = max width of output thumbnail in pixels
203   h = max height of output thumbnail in pixels
204  wp = max width for portrait images
205  hp = max height for portrait images
206  wl = max width for landscape images
207  hl = max height for landscape images
208  ws = max width for square images
209  hs = max height for square images
210   f = output image format, one of:
211       ("jpeg", "png", "gif", "webp", "wbmp", "ico", "bmp")
212   q = JPEG compression (1=worst, 95=best, 75=default)
213  sx = left side of source rectangle (default = 0)
214       (values 0 < sx < 1 represent percentage)
215  sy = top side of source rectangle (default = 0)
216       (values 0 < sy < 1 represent percentage)
217  sw = width of source rectangle (default = fullwidth)
218       (values 0 < sw < 1 represent percentage)
219  sh = height of source rectangle (default = fullheight)
220       (values 0 < sh < 1 represent percentage)
221  zc = zoom-crop. Will auto-crop off the larger dimension
222       so that the image will fill the smaller dimension
223       (requires both "w" and "h", overrides "iar", "far")
224       Set to "1" or "C" to zoom-crop towards the center,
225       or set to "T", "B", "L", "R", "TL", "TR", "BL", "BR"
226       to gravitate towards top/left/bottom/right directions
227       (requies ImageMagick for values other than "C" or "1")
228 ica = ImageCropAuto, requires (PHP 5 >= 5.5.0, PHP 7)
229       https://www.php.net/manual/en/function.imagecropauto.php
230       value can be 0-4 (IMG_CROP_DEFAULT, IMG_CROP_TRANSPARENT,
231       IMG_CROP_BLACK, IMG_CROP_WHITE, IMG_CROP_SIDES) or can be
232       "5|<threshold>|<bgcolor>" where <threshold> is between 0
233       and 1, and <bgcolor> is the hex background color
234  bg = background hex color (default = FFFFFF)
235  bc = border hex color (default = 000000)
236fltr = filter system. Call as an array as follows:
237       - "brit" (Brightness) [ex: &fltr[]=brit|<value>]
238         where <value> is the amount +/- to adjust brightness
239         (range -255 to 255)
240         Available in PHP5 with bundled GD only.
241       - "cont" (Constrast) [ex: &fltr[]=cont|<value>]
242         where <value> is the amount +/- to adjust contrast
243         (range -255 to 255)
244         Available in PHP5 with bundled GD only.
245       - "gam" (Gamma Correction) [ex: &fltr[]=gam|<value>]
246         where <value> can be a number 0.01 to 10 (default 1.0)
247         Must be >0 (zero gives no effect). There is no max,
248         although beyond 10 is pretty useless. Negative
249         numbers actually do something, maybe not quite the
250         desired effect, but interesting nonetheless.
251       - "sat" (SATuration) [ex: &fltr[]=sat|<value>]
252         where <value> is a number between zero (no change)
253         and -100 (complete desaturation = grayscale), or it
254         can be any positive number for increased saturation.
255       - "ds" (DeSaturate) [ex: &fltr[]=ds|<value>]
256         is an alias for "sat" except values are inverted
257         (positive values remove color, negative values boost
258         saturation)
259       - "gray" (Grayscale) [ex: &fltr[]=gray]
260         remove all color from image, make it grayscale
261       - "th" (Threshold) [ex: &fltr[]=th|<value>]
262         makes image greyscale, then sets all pixels brighter
263         than <value> (range 0-255) to white, and all pixels
264         darker than <value> to black
265       - "rcd" (Reduce Color Depth) [ex: &fltr[]=rcd|<c>|<d>]
266         where <c> is the number of colors (2-256) you want
267         in the output image, and <d> is "1" for dithering
268         (deault) or "0" for no dithering
269       - "clr" (Colorize) [ex: &fltr[]=clr|<value>|<color>]
270         where <value> is a number between 0 and 100 for the
271         amount of colorization, and <color> is the hex color
272         to colorize to.
273       - "sep" (Sepia) [ex: &fltr[]=sep|<value>|<color>]
274         where <value> is a number between 0 and 100 for the
275         amount of colorization (default=50), and <color> is
276         the hex color to colorize to (default=A28065).
277         Note: this behaves differently when applied by
278         ImageMagick, in which case 80 is default, and lower
279         values give brighter/yellower images and higher
280         values give darker/bluer images
281       - "usm" (UnSharpMask) [ex: &fltr[]=usm|<a>|<r>|<t>]
282         where <a> is the amount (default = 80, range 0-255),
283         <r> is the radius (default = 0.5, range 0.0-10.0),
284         <t> is the threshold (default = 3, range 0-50).
285       - "blur" (Blur) [ex: &fltr[]=blur|<radius>]
286         where (0 < <radius> < 25) (default = 1)
287       - "gblr" (Gaussian Blur) [ex: &fltr[]=gblr]
288         Available in PHP5 with bundled GD only.
289       - "sblr" (Selective Blur) [ex: &fltr[]=gblr]
290         Available in PHP5 with bundled GD only.
291       - "smth" (Smooth) [ex: &fltr[]=smth|<value>]
292         where <value> is the weighting value for the matrix
293         (range -10 to 10, default 6)
294         Available in PHP5 with bundled GD only.
295       - "lvl" (Levels)
296         [ex: &fltr[]=lvl|<channel>|<method>|<threshold>
297         where <channel> can be one of 'r', 'g', 'b', 'a' (for
298         Red, Green, Blue, Alpha respectively), or '*' for all
299         RGB channels (default) based on grayscale average.
300         ImageMagick methods can support multiple channels
301         (eg "lvl|rg|3") but internal methods cannot (they will
302         use first character of channel string as channel)
303         <method> can be one of:
304         0=Internal RGB;
305         1=Internal Grayscale;
306         2=ImageMagick Contrast-Stretch (default)
307         3=ImageMagick Normalize (may appear over-saturated)
308         <threshold> is how much of brightest/darkest pixels
309         will be clipped in percent (default = 0.1%)
310         Using default parameters (&fltr[]=lvl) is similar to
311         Auto Contrast in Adobe Photoshop.
312       - "wb" (White Balance) [ex: &fltr[]=wb|<c>]
313         where <c> is the target hex color to white balance
314         on, this color is what "should be" white, or light
315         gray. The filter attempts to maintain brightness so
316         any gray color can theoretically be used. If <c> is
317         omitted the filter guesses based on brightest pixels
318         in each of RGB
319         OR <c> can be the percent of white clipping used
320         to calculate auto-white-balance (default = 0.1%)
321         NOTE: "wb" in default settings already gives an effect
322         similar to "lvl", there is usually no need to use "lvl"
323         if "wb" is already used.
324       - "hist" (Histogram)
325         [ex: &fltr[]=hist|<b>|<c>|<w>|<h>|<a>|<o>|<x>|<y>]
326         Where <b> is the color band(s) to display, from back
327         to front (one or more of "rgba*" for Red Green Blue
328         Alpha and Grayscale respectively);
329         <c> is a semicolon-separated list of hex colors to
330         use for each graph band (defaults to FF0000, 00FF00,
331         0000FF, 999999, FFFFFF respectively);
332         <w> and <h> are the width and height of the overlaid
333         histogram in pixels, or if <= 1 then percentage of
334         source image width/height;
335         <a> is the alignment (same as for "wmi" and "wmt");
336         <o> is opacity from 0 (transparent) to 100 (opaque)
337             (requires PHP v4.3.2, otherwise 100% opaque);
338         <x> and <y> are the edge margin in pixels (or percent
339             if 0 < (x|y) < 1)
340       - "over" (OVERlay/underlay image) overlays an image on
341         the thumbnail, or overlays the thumbnail on another
342         image (to create a picture frame for example)
343         [ex: &fltr[]=over|<i>|<u>|<m>|<o>]
344         where <i> is the image filename; <u> is "0" (default)
345         for overlay the image on top of the thumbnail or "1"
346         for overlay the thumbnail on top of the image; <m> is
347         the margin - can be absolute pixels, or if < 1 is a
348         percentage of the thumbnail size [must be < 0.5]
349         (default is 0 for overlay and 10% for underlay);
350         <o> is opacity (0 = transparent, 100 = opaque)
351             (requires PHP v4.3.2, otherwise 100% opaque);
352         (thanks raynerape�gmail*com, shabazz3�msu*edu)
353       - "wmi" (WaterMarkImage)
354         [ex: &fltr[]=wmi|<f>|<a>|<o>|<x>|<y>|<r>] where
355         <f> is the filename of the image to overlay;
356         <a> is the alignment (one of BR, BL, TR, TL, C,
357             R, L, T, B, *) where B=bottom, T=top, L=left,
358             R=right, C=centre, *=tile)
359             *or*
360             an absolute position in pixels (from top-left
361             corner of canvas to top-left corner of overlay)
362             in format {xoffset}x{yoffset} (eg: "10x20")
363             note: this is center position of image if <x>
364             and <y> are set
365         <o> is opacity from 0 (transparent) to 100 (opaque)
366             (requires PHP v4.3.2, otherwise 100% opaque);
367         <x> and <y> are the edge (and inter-tile) margin in
368             pixels (or percent if 0 < (x|y) < 1)
369             *or*
370             if <a> is absolute-position format then <x> and
371             <y> represent maximum width and height that the
372             watermark image will be scaled to fit inside
373         <r> is rotation angle of overlaid watermark
374       - "wmt" (WaterMarkText)
375         [ex: &fltr[]=wmt|<t>|<s>|<a>|<c>|<f>|<o>|<m>|<n>|<b>|<O>|<x>|<h>]
376         where:
377         <t> is the text to use as a watermark;
378             URLencoded Unicode HTMLentities must be used for
379               characters beyond chr(127). For example, the
380               "eighth note" character (U+266A) is represented
381               as "&#9834;" and then urlencoded to "%26%239834%3B"
382             Any instance of metacharacters will be replaced
383             with their calculated value. Currently supported:
384               ^Fb = source image filesize in bytes
385               ^Fk = source image filesize in kilobytes
386               ^Fm = source image filesize in megabytes
387               ^X  = source image width in pixels
388               ^Y  = source image height in pixels
389               ^x  = thumbnail width in pixels
390               ^y  = thumbnail height in pixels
391               ^^  = the character ^
392         <s> is the font size (1-5 for built-in font, or point
393             size for TrueType fonts);
394         <a> is the alignment (one of BR, BL, TR, TL, C, R, L,
395             T, B, * where B=bottom, T=top, L=left, R=right,
396             C=centre, *=tile);
397             note: * does not work for built-in font "wmt"
398             *or*
399             an absolute position in pixels (from top-left
400             corner of canvas to top-left corner of overlay)
401             in format {xoffset}x{yoffset} (eg: "10x20")
402         <c> is the hex color of the text;
403         <f> is the filename of the TTF file (optional, if
404             omitted a built-in font will be used);
405         <o> is opacity from 0 (transparent) to 100 (opaque)
406             (requires PHP v4.3.2, otherwise 100% opaque);
407         <m> is the edge (and inter-tile) margin in percent;
408         <n> is the angle
409         <b> is the hex color of the background;
410         <O> is background opacity from 0 (transparent) to
411             100 (opaque)
412             (requires PHP v4.3.2, otherwise 100% opaque);
413         <x> is the direction(s) in which the background is
414             extended (either 'x' or 'y' (or both, but both
415             will obscure entire image))
416             Note: works with TTF fonts only, not built-in
417         <h> is the scale multiplier for line height/spacing
418             default is 1.0
419       - "flip" [ex: &fltr[]=flip|x   or   &fltr[]=flip|y]
420         flip image on X or Y axis
421       - "ric" [ex: &fltr[]=ric|<x>|<y>]
422         rounds off the corners of the image (to transparent
423         for PNG output), where <x> is the horizontal radius
424         of the curve and <y> is the vertical radius
425       - "elip" [ex: &fltr[]=elip]
426         similar to rounded corners but more extreme
427       - "mask" [ex: &fltr[]=mask|filename.png|<i>]
428         greyscale values of mask are applied as the alpha
429         channel to the main image. White is opaque, black
430         is transparent, unless the <i> (invert) parameter is
431         set to 1 in which case black is opaque and white is
432         transparent
433       - "bvl" (BeVeL) [ex: &fltr[]=bvl|<w>|<c1>|<c2>]
434         where <w> is the bevel width, <c1> is the hex color
435         for the top and left shading, <c2> is the hex color
436         for the bottom and right shading
437       - "bord" (BORDer) [ex: &fltr[]=bord|<w>|<rx>|<ry>|<c>
438         where <w> is the width in pixels, <rx> and <ry> are
439         horizontal and vertical radii for rounded corners,
440         and <c> is the hex color of the border
441       - "fram" (FRAMe) draws a frame, similar to "bord" but
442         more configurable
443         [ex: &fltr[]=fram|<w1>|<w2>|<c1>|<c2>|<c3>]
444         where <w1> is the width of the main border, <w2> is
445         the width of each side of the bevel part, <c1> is the
446         hex color of the main border, <c2> is the highlight
447         bevel color, <c3> is the shadow bevel color
448       - "drop" (DROP shadow)
449         [ex: &fltr[]=drop|<d>|<w>|<clr>|<a>|<o>]
450         where <d> is distance from image to shadow, <w> is
451         width of shadow fade (not yet implemented), <clr> is
452         the hex color of the shadow, <a> is the angle of the
453         shadow (default=225), <o> is opacity (0=transparent,
454         100=opaque, default=100) (not yet implemented)
455       - "crop" (CROP image)
456         [ex: &fltr[]=crop|<l>|<r>|<t>|<b>]
457         where <l> is the number of pixels to crop from the left
458         side of the resized image; <r>, <t>, <b> are for right,
459         top and bottom respectively. Where (0 < x < 1) the
460         value will be used as a percentage of width/height.
461         Left and top crops take precedence over right and
462         bottom values. Cropping will be limited such that at
463         least 1 pixel of width and height always remains.
464       - "rot" (ROTate)
465         [ex: &fltr[]=rot|<a>|<b>]
466         where <a> is the rotation angle in degrees; <b> is the
467         background hex color. Similar to regular "ra" parameter
468         but is applied in filter order after regular processing
469         so you can rotate output of other filters.
470       - "size" (reSIZE)
471         [ex: &fltr[]=size|<x>|<y>|<s>]
472         where <x> is the horizontal dimension in pixels, <y> is
473         the vertical dimension in pixels, <s> is boolean whether
474         to stretch (if 1) or resize proportionately (0, default)
475         <x> and <y> will be interpreted as percentage of current
476         output image size if values are (0 < X < 1)
477         NOTE: do NOT use this filter unless absolutely necessary.
478         It is only provided for cases where other filters need to
479         have absolute positioning based on source image and the
480         resultant image should be resized after other filters are
481         applied. This filter is less efficient than the standard
482         resizing procedures.
483       - "stc" (Source Transparent Color)
484         [ex: &fltr[]=stc|<c>|<n>|<x>]
485         where <c> is the hex color of the target color to be made
486         transparent; <n> is the minimum threshold in percent (all
487         pixels within <n>% of the target color will be 100%
488         transparent, default <n>=5); <x> is the maximum threshold
489         in percent (all pixels more than <x>% from the target
490         color will be 100% opaque, default <x>=10); pixels between
491         the two thresholds will be partially transparent.
492md5s = MD5 hash of the source image -- if this parameter is
493       passed with the hash of the source image then the
494       source image is not checked for existence or
495       modification and the cached file is used (if
496       available). If 'md5s' is passed an empty string then
497       phpThumb.php dies and outputs the correct MD5 hash
498       value.  This parameter is the single-file equivalent
499       of 'cache_source_filemtime_ignore_*' configuration
500       parameters
501 xto = EXIF Thumbnail Only - set to only extract EXIF
502       thumbnail and not do any additional processing
503  ra = Rotate by Angle: angle of rotation in degrees
504       positive = counterclockwise, negative = clockwise
505  ar = Auto Rotate: set to "x" to use EXIF orientation
506       stored by camera. Can also be set to "l" or "L"
507       for landscape, or "p" or "P" for portrait. "l"
508       and "P" rotate the image clockwise, "L" and "p"
509       rotate the image counter-clockwise.
510 sfn = Source Frame Number - use this frame/page number for
511       multi-frame/multi-page source images (GIF, TIFF, etc)
512 aoe = Output Allow Enlarging - override the setting for
513       $CONFIG['output_allow_enlarging'] (1=on, 0=off)
514       ("far" and "iar" both override this and allow output
515       larger than input)
516 iar = Ignore Aspect Ratio - disable proportional resizing
517       and stretch image to fit "h" & "w" (which must both
518       be set).  (1=on, 0=off)  (overrides "far")
519 far = Force Aspect Ratio - image will be created at size
520       specified by "w" and "h" (which must both be set).
521       Alignment: L=left,R=right,T=top,B=bottom,C=center
522       BL,BR,TL,TR use the appropriate direction if the
523       image is landscape or portrait.
524 dpi = Dots Per Inch - input DPI setting when importing from
525       vector image format such as PDF, WMF, etc
526 sia = Save Image As - default filename to save generated
527       image as. Specify the base filename, the extension
528       (eg: ".png") will be automatically added
529maxb = MAXimum Byte size - output quality is auto-set to
530       fit thumbnail into "maxb" bytes  (compression
531       quality is adjusted for JPEG, bit depth is adjusted
532       for PNG and GIF)
533down = filename to save image to. If this is set the
534       browser will prompt to save to this filename rather
535       than display the image
536
537// Deprecated:
538file = if set then thumbnail will be rendered to this
539       filename, not output and not cached.
540       (Deprecated. Disabled by default since v1.6.0,
541       unavailable in v1.7.5 and later. You should
542       instantiate your own object instead)
543goto = URL to redirect to after rendering image to file
544       * Must begin with "http://"
545       * Requires file parameter set
546       (Deprecated. Disabled by default since v1.6.0,
547       unavailable in v1.7.5 and later. You should
548       instantiate your own object instead)
549 err = custom error image filename instead of showing
550       error messages (for use on production sites)
551       (Deprecated. Disabled by default since v1.6.0,
552       unavailable in v1.7.5 and later. You should
553       instantiate your own object instead)
554
555
556==============
557General Notes:
558==============
559
560* Always use the local image filename wherever possible
561  rather than a full http:// URL because performance is
562  much better, less (or no) use of temp files, and the
563  last-modified check for cached files doesn't work for
564  remote files. For example:
565   good: phpThumb.php?src=/images/nicepic.jpg
566    bad: phpThumb.php?src=/home/httpd/example/images/nicepic.jpg
567  worse: phpThumb.php?src=http://example.com/images/nicepic.jpg
568
569* Thumbnails will be scaled proportionately to fit in a
570  box of at most (width * height) pixels
571  (unless "iar" is set)
572
573* Thumbnail caching for URL or database sources requires
574  an absolute directory name for $config_cache_directory
575  Physical file cached thumbnails will be recreated if
576  the source file changes, but remote/database files
577  cannot (modification time isn't readily available)
578
579* If you need a GUI interface to phpThumb(), or for a user
580  to specify crop settings, or something like that please
581  see the list of known programs in /demo/readme.demos.txt
582
583* Cropping images can be specified with either exact pixel
584  values for sx/sy/sw/sh parameters, or if those are set
585  to a value >0 and <1 then these are interpreted as a
586  percentage of the source image width/height. For example,
587  to crop 25% off all sides, you would specify parameters:
588  phpThumb.php?src=pic.jpg&sx=.25&sy=.25&sw=.5&sh=.5
589
590* phpThumb() may have tempfile access issues on servers
591  where Safe Mode is enabled, specificly when accessing
592  a file over HTTP, or when a non-bundled version of GD
593  is in use. Specifying "config_temp_directory" may help
594
595* Properly resolving /~user/ style filenames requires
596  apache_lookup_uri(), which is missing or broken in
597  Apache2, or if PHP is not installed as an Apache module.
598  phpThumb() does try and work around this if it is
599  unavailable, but you may have to specify a full filename
600  for "src" if you encounter problems.
601
602* phpThumb() should work with PHP v4.0.6+, but seems to
603   have a few quirks before v4.1.0
604  EXIF thumbnail extraction requires PHP v4.2.0+
605  Image rotation requires PHP v4.3.0+. There have been
606    reports of problems with PHP older than v4.3.3
607  Partial transparency for overlays requires PHP v4.3.2+
608  Some image filters require PHP v5.0.0+
609  Run /demo/phpThumb.demo.check.php to examine your server
610
611* phpThumb() works better and faster when ImageMagick is
612  available. Most functions will work with only GD2, but
613  speed is much faster with ImageMagick, and much larger
614  images can be processed with ImageMagick than GD.
615
616* phpThumb() works with GD v1.x, but works better with
617   GD v2.0+ because of the true-color image support
618   and ImageCopyResampled(). Also, there appears to be a
619   bug in ImageCopyResized() which is used with GD v1.x
620   where the bottom and/or right line of pixels is set
621   to the background color (due to a rounding error?)
622  NOTE: Please use the bundled version of GD if at all
623   possible (with PHP v4.3.0+) because the non-bundled
624   version has bugs which may cause PHP to crash:
625   * http://bugs.php.net/bug.php?id=21518
626   * http://bugs.php.net/bug.php?id=24174
627   phpThumb() has a workaround for the above bug but
628   there may be other bugs, and the workaround is slow.
629  Alpha transparent output requires GD >= 2.0.1 and
630   PHP >= 4.3.2
631  Most (if not all) filters require GD v2.x to function
632   at all. But many filters can be handled by ImageMagick
633   instead of GD.
634
635* Filters handled by ImageMagick or GD:
636  - brit;cont;ds;sat;gray;clr;sep;gam;neg;th;rcd;flip;edge;
637    emb;lvl;blur;gblr;usm;wb;
638* Filters handled only by ImageMagick:
639  - none yet
640* Filters handled only by GD + PHP5:
641  - sblr;mean;smth;
642* Filters handled only by GD2:
643  - bvl;wmi;wmt;over;hist;fram;drop;mask;elip;ric;bord;
644
645* Some browsers, notably Internet Explorer (before v7.0),
646  have problems with PNG transparency. See description:
647    http://www.silisoftware.com/png_alpha_transparency/
648    http://trific.ath.cx/web/png/
649  There are some work-around fixes for this IE problem, eg:
650    http://www.twinhelix.com/css/iepngfix/demo/
651
652
653===============
654Thanks & Links:
655===============
656
657* Original image used in phpThumb logo provided by
658  Mark James: http://www.famfamfam.com/lab/icons/
659
660
661
662========================================
663== phpThumb Commercial License (pTCL) ==
664========================================
665
666See /docs/phpthumb.license.commercial.txt
667for details on the terms of the license.
668
669Current list of pTCL licensees:
670(updated list at http://www.phpthumb.com/)
671
6721) Accomplish Hosting, LLC
673   http://www.accomplishhosting.com
674   effective 2007-Apr-28 (lifetime license)
675
6762) Eric Pujol
677   http://www.kaprikorn.fr/
678   effective 2007-Sep-29 (lifetime license)
679
6803) CalemEAM Inc.
681   http://www.calemeam.com/
682   effective 2010-Jun-14 (lifetime license)