////////////////////////////////////////////////////////////// /// phpThumb() by James Heinrich // // available at http://phpthumb.sourceforge.net /// ////////////////////////////////////////////////////////////// v1.6.3 - December ??, 2005 * Bugfix: safe mode warnings in ImageCreateFromStringReplacement (thanks adminØalex-home*net) * Bugfix: 'new' got broken (1x1 images) v1.6.2 - November 24, 2005 * Animated GIF output is now possible if ImageMagick is available and no filters (other than resize) are applied (thanks brandenbassØgmail*com for idea) * Added $PHPTHUMB_CONFIG['cache_force_passthru'] to work around cached-image-only-works-second-time issue (thanks yakoØ11y11*com) * Bugfix: black borders on some image edges (thanks atelierØdelirius*ch && chuckØcatalyststudio*com) * Bugfix: uncaught PHP warning in RenderToFile DebugMessage * Bugfix: allow phpThumbDebug in noGD PHP installations * Bugfix: 'hash' warning in high_security mode (thanks bernhardØwtf*at) * Bugfix: non-TTF rotated text watermarks now work (unrotated) with no warnings if ImageRotate is unavailable (thanks aparviaiØusers*sourceforge*net) v1.6.1 - August 26, 2005 * Filters now use GD functions where available (using ImageFilter, only available in PHP v5.0.0+ with bundled version of GD). Enabled for: colorize, negative, grayscale, brightness, contrast, gaussian blur, selective blur, mean removal (thanks donlaurØmac*com) * Added config_prefer_imagemagick (defaults=true) * Added phpthumb_filters::Grayscale() 'gray' * Added phpthumb_filters::ReduceColorDepth() 'rcd' * Added phpthumb_filters::Brightness() 'brit' * Added phpthumb_filters::Contrast() 'cont' * Added phpthumb_filters::Saturation() 'sat' * Added phpthumb_filters::EdgeDetect() 'edge' [PHP5 only] * Added phpthumb_filters::BlurGaussian() 'gblr' [PHP5 only] * Added phpthumb_filters::BlurSelective() 'gblr' [PHP5 only] * Added phpthumb_filters::MeanRemoval() 'mean' [PHP5 only] * Added phpthumb_filters::Smooth() 'smth' [PHP5 only] * New timing debug info in phpThumbDebug * Added config_cache_differentiate_offsite * config_die_on_error now defaults to false * ResolveSource works better * cache filenames with 'fltr' parameters have changed * Filters now skip processing if amount=0 or similar * [#1263051] 'far' now accepts L,R,T,B,C as values giving alignment of left/right/top/bottom/center respectively. Old value of '1' defaults to centered (thanks webgrappaØusers*sourceforge*net) * Bugfix: RenderToFile() now fails properly when output format is unknown * Bugfix: PNG transparency wasn't working with 'far' * Bugfix: source images with EXIF thumbnails that differ in aspect ratio no longer use EXIF thumbnails as source unless no other options exist * Bugfix: setting 'src' with setParameter now invokes setSourceFilename to properly set $this->sourceFilename (thanks Gazou) * Bugfix: 'zc' had poor quality when used with ImageMagick * Bugfix: 'aoe' parameter broken when not using ImageMagick (thanks frankieali4Øhotmail*com) * Bugfix: fixed issue with symbolic links (thanks hornet136Øgmail*com) * Bugfix: config_max_source_pixels now defaults to same calculation as used in phpThumb.config.php (thanks vukshaØhotmail*com) * Bugfix: Offsite cached thumbnails no longer use unique referer (now either nothing or "_offsite") (thanks swaayeØyahoo*com) * Bugfix: "Unknown image type identified by “] where is the target hex color to white balance on, this color is what "should be" white, or light gray. The filter attempts to maintain brightness so any gray color can theoretically be used. If is omitted the filter guesses based on brightest pixels in each of RGB * Cached files are used by a Location header instead of being passed through phpThumb.php using readfile (thanks newtnØthrillnerds*com) * Added 'cache_source_filemtime_ignore_local' and 'cache_source_filemtime_ignore_remote' configurations to ignore source modification and/or removal (thanks raynerapeØgmail*com) * Added 'md5s' parameter, which is the MD5 hash of the source image -- if this parameter is passed with the hash of the source image then the source image is not checked for existance or modification and the cached file is used (if available). If 'md5s' is passed an empty string then phpThumb.php dies and outputs the correct MD5 hash value. This parameter is the single- file equivalent of 'cache_source_filemtime_ignore_*' configuration paramters (thanks raynerapeØgmail*com) * Added /demo/phpThumb.demo.object.php * Unused parameter 'bgt' removed * Added empty /cache/source/ directory to distribution * Added /demo/ and /docs/ and /fonts/ directories * Set default config_use_exif_thumbnail_for_speed = false * Bugfix: Wrapped output buffering around all include_once calls to prevent headers getting sent accidentally * Bugfix: md5_file and imagecolorallocatealpha calls were undefined under PHP v4.1.x (thanks tomØemile*com) * Bugfix: default 'f' parameter ('jpeg') overrode config_output_format in object mode (thanks mailØmmjaeger*com) * Bugfix: suppressed error message for IIS shell_exec errors (thanks tomØemile*com) * Bugfix: Added PHP version check for stream_set_timeout for HTTP sources (thanks raynerapeØgmail*com) * Bugfix: overlay margins of 0.5-1.0 cause invalid image dimensions error (thanks mailØmmjaeger*com) * Bugfix: underlay margins were not working (thanks mailØmmjaeger*com) * Bugfix: [#1187735] EXIF thumbnails were incorrectly output to the browser directly if requested thumbnail exactly matched EXIF dimensions (thanks rebootØusers*sourceforge*net) v1.5.2 - April 20, 2005 * phpThumb.config.php is renamed to phpThumb.config.php.default to prevent accidental overwriting. Please migrate your old settings to the new file, delete your old config and rename the default to phpThumb.config.php * Added new filters: - 'blur' (Blur) [ex: &fltr[]=blur|] where (0 < < 25) (default = 1) (thanks thoensiØnetcom*no for code) - 'hist' (Histogram) [ex: &fltr[]=hist|||||||] Where is the color band(s) to display, from back to front (one or more of "rgba*" for Red Green Blue Alpha and Grayscale respectively); is a semicolon-seperated list of hex colors to use for each graph band (defaults to FF0000, 00FF00, 0000FF, 999999, FFFFFF respectively); and are the width and height of the overlaid histogram in pixels, or if <= 1 then percentage of source image width/height; is the alignment (same as for "wmi" and "wmt"); is opacity from 0 to 100; is the edge (and inter-tile) margin in percent - 'over' (OVERlay/underlay image) overlays an image on the thumbnail, or overlays the thumbnail on another image (to create a picture frame for example) [ex: &fltr[]=over||||] where is the image filename; is "0" (default) for overlay the image on top of the thumbnail or "1" for overlay the thumbnail on top of the image; is the margin - can be absolute pixels, or if < 1 is a percentage of the thumbnail size [must be < 0.5] (default is 0 for overlay and 10% for underlay); is opacity (0 = transparent, 100 = opaque) (thanks raynerapeØgmail*com, shabazz3Ømsu*edu) - 'gray' (GRAYscale) [ex: &fltr[]=gray] is an alias to 100% desaturation * New configuration 'cache_source_directory' allows the unprocessed source image to be cached when source is HTTP or from a database (thanks raynerapeØgmail*com) * Added 'cache' subdirectory to phpThumb distribution since this is the default location for the cache folder. * Default value for config_error_die_on_source_failure changed to true (thanks shabazz3Ømsu*edu) * Added checks to make sure $this->gdimg_output is a resource before allowing calls to RenderToFile or OutputThumbnail * Better error messages when phpThumb.config.php missing * Bugfix: watermark overlay margins were wrong * Bugfix: 'lvl' filter no longer processes if not needed * Bugfix: off-server thumbnail error message was wrong * Bugfix: several PHP safe mode fixes (thanks virginiaØalertbutnotalarmed*com) * Bugfix: cache filenames broken for filter parameters with paths (thanks srcericØusers.sourceforge.net) v1.5.1 - April 06, 2005 * Added some security upgrades: - 'config_*' parameters cannot be passed by GETstring - 'config_nooffsitelink_require_refer' is a new option (disabled by default) that only allows calls to phpThumb() from a refering domain listed in 'config_nooffsitelink_valid_domains' - disallowed paramters now generate an error image if present in the GETstring - 'high_security_enabled' if set to true enabled new mode of verification, and requires a small function to generate a hash for calls to phpThumb: echo ''; This function is supplied at the bottom of phpThumb.config.php (thanks paulØstonie*co*uk) * Added new parameter "new" (phpThumb.php only) which can create a new image without using "src" parameter. Set "&new=|" where is the background hex color, is (optional) opacity (0=transparent, 100=opaque). (thanks mailØmmjaeger*com) * Added new filters: - 'sep' (Sepia) [ex: &fltr[]=sep||] where is a number between 0 and 100 for the amount of colorization (default=50), and is the hex color to colorize to (default=A28065). (thanks mailØmmjaeger*com) - 'lvl' (Levels) [ex: &fltr[]=lvl||| where can be one of 'r', 'g', 'b', 'a' (for Red, Green, Blue, Alpha respectively), or '*' for all channels based on average grayscale value (default). and are the clip points for the levels (range = 0-255) and are set to clip 0.1% of each end by default. Use -1 for min and/or max to invoke auto- detect mode. Using default parameters (&fltr[]=lvl) is similar to Auto Contrast in Adobe Photoshop. * Bugfix: Image MIME header was incorrect for cached images. * Bugfix: Cache was broken for images pulled from a database in phpThumb.php (thanks dragutin*cvetkovicØdragontech-ltd*com) * Bugfix: Hotlink/Offsite prevention was broken when image was already cached. * Bugfix: ImageMagick path was incorrect in some cases (thanks joshgØtwcny*rr*com) * Bugfix: ProportionalResize() in phpthumb.functions.php had a broken check for default values (thanks Bert*ClaeysØarinso*com) * Bugfix: transparency now preserved for GIF & PNG input (thanks tristanØcyrax*ch) * Bugfix: transparency now supported for GIF output (thanks j_ivanovØabv*bg) * Bugfix: alpha transparency could be lost in ApplyMask() (thanks analyzerxØgmail*com) * Bugfix: errors on 16/32-bit BMPs (thanks mattØhellstrominc*com) * Bugfix: Added datestamp to cached filenames for remote (HTTP) files, and better warning for caching (thanks a*gambinoØabramo*it) * Faster BMP parsing (thanks sgeppertØmail*utexas*edu) * Added 'error_die_on_source_failure' configuration to allow invalid source images to show an error rather than output unmodified source image. (thanks mindpixelØgmail*com) * Added $phpThumb->fatalerror which will contain the text of the fatal error if 'error_die_on_error' is false. (thanks mindpixelØgmail*com) v1.5.0 - February 4, 2005 * Added new filter parameter 'fltr' that is an array and can apply multiple effects in sequence. Current filters that can be called are: - 'gam' (Gamma Correction) [ex: &fltr[]=gam|] where can be a number >0 to 10+ (default 1.0) - 'ds' (DeSaturate) [ex: &fltr[]=ds|] where is a number between zero (no change) and 100 (complete desaturation -- grayscale), or it can be a negative number for saturation boost. (thanks mailØmmjaeger*com) - 'clr' (Colorize) [ex: &fltr[]=clr||] where is a number between 0 and 100 for the amount of colorization, and is the hex color to colorize to. (thanks mailØmmjaeger*com) - 'neg' (Negative) [ex: &fltr[]=neg] inverts the color - 'th' (ThresHold) [ex: &fltr[]=th|] (range 0-255) every grayscale pixel brighter than is set to white, every darker pixel is set to black (thanks mailØmmjaeger*com) - 'usm' (UnSharpMask) [ex: &fltr[]=usm|||] where is the amount (default = 80), is the radius (default = 0.5), is the threshold (default = 3). - 'wmi' (WaterMarkImage) [ex: &fltr[]=wmi||||] where is the filename of the image to overlay, is the alignment (one of BR, BL, TR, TL, C, R, L, T, B, * where B=bottom, T=top, L=left, R=right, C=centre, *=tile), is opacity from 0 to 100, is the edge (and inter-tile) margin in percent - 'wmt' (WaterMarkText) [ex: &fltr[]=wmt||||||||] where: is the text to use as a watermark, is the font size (1-5 for built-in font, or point size for TrueType fonts), is the alignment (one of BR, BL, TR, TL, C, R, L, T, B, * where B=bottom, T=top, L=left, R=right, C=centre, *=tile), is the hex color of the text is the filename of the TTF file (optional, if omitted a built-in font will be used) is opacity from 0 to 100, is the edge (and inter-tile) margin in percent is the angle (thanks mailØmmjaeger*com) - 'flip' [ex: &fltr[]=flip|x or &fltr[]=flip|y] flip image on X or Y axis (thanks mailØmmjaeger*com) - 'elip' [ex: &fltr[]=elip] similar to rounded corners but more extreme (thanks mailØmmjaeger*com) - 'mask' [ex: &fltr[]=mask|filename.png] greyscale values of mask are applied as the alpha channel to the main image. White is opaque, black is transparent. - 'bvl' (BeVeL) [ex: &fltr[]=bvl|||] where is the bevel width, is the hex color for the top and left shading, is the hex color for the bottom and right shading (thanks mailØmmjaeger*com) - 'fram' (FRAMe) draws a frame, similar to border but more configurable (thanks mailØmmjaeger*com) [ex: &fltr[]=fram|||||] where is the width of the main border, is the width of each side of the bevel part, is the hex color of the main border, is the highlight bevel color, is the shadow bevel color - 'drop' (DROP shadow) [ex: &fltr[]=drop||||] where is distance from image to shadow, is width of shadow fade (not yet implemented), is the hex color of the shadow, and is the angle of the shadow (default=225) - 'ric' (Rounded Image Corners) [ex: &fltr[]=ric||] where is the horizontal corner radius, is the vertical corner radius * Split out filter functions into phpthumb.filters.php * 'usa','usr','ust' parameters have been removed and replaced with the 'fltr' call (see above) * 'wmf','wma','wmp','wmm' parameters have been removed and replaced with the 'fltr' call (see above) * 'brx','bry','bw' parameters have been removed and replaced with the 'fltr' call (see above) * 'bw=0' to force aspect ratio has been replaced by 'far=1' (force aspect ratio) * Filters that produce transparent sections (such as Rounded Corners, Ellipse, Mask, Rotate) are now output as 32-bit/alpha PNG, or flattened with "bg" background color for JPEG/GIF output (thanks mailØmmjaeger*com) * Added 'zc' (Zoom Crop) parameter (thanks arcookeØgmail*com, mailØmmjaeger*com, pl16056Ømacnews*de, kezzasmØusers*sourceforge*net, etc) * AutoRotate now can use EXIF orientation tag ('ar=x') * Added 'ttf_directory' configuration parameter for TrueType watermarks (thanks mailØmmjaeger*com) * Added "Last-Modified" header to cache portion of phpThumb.php which should allow better user-side caching of thumbnails. (thanks derekØnetsimple*net) * Added 'cache_disable_warning' configuration which will cause an error image to be displayed if the cache directory isn't configured, unless explicitly disabled * Added 'nooffsitelink_enabled' configuration which prevents linking to thumbnails on your server from another domain. Defaults to watermaking linked images with text warning message. (thanks anteØabstraktmedia*com) * Added 'error_image_width' & 'error_image_height' config variables (thanks mailØmmjaeger*com) * Rounded image corners now requires GD v2.0.1 and PHP v4.3.2. Corners are transparent (for PNG output) and antialiased. * Rotate by arbitary angle ('ra') now has a transparent background for PNG output * Cached filenames now have an additional component for applied filters * Cached filenames now have an additional component for HTTP referer, but only if the refering domain does not match the domain of the server (designed to prevent imaged linked from offsite with error message being cached the same as the local cached version) * Added setSourceImageResource() to allow use of an existing GD image resource for thumbnailing (thanks danØgonmad*co*uk) * Now including phpThumb.demo.demo1.php (main demo page) and phpThumb.demo.demo2.php (configurable demo page) in the phpThumb() distribution (thanks mailØmmjaeger*com) * Added many more debugging/tracing message points * Added set_time_limit(30) to phpThumb.php * Bugfix: ImageMagick not used if `which convert` points to a link and not a file (thanks bkainersØgmail*com) * Bugfix: 'bgt' parameter was sometimes misspelled 'bct' * Bugfix: 'wmm' couldn't be set to zero * Bugfix: 'wmm' parameter was only applied to top/left of image * Bugfix: auto-detection of document_root failed on Windows (thanks xbartvØhotmail*com) * Bugfix: phpThumbDebug could be bypassed if EXIF thumbnail present (thanks olgradinØcheckfree*com) * Bugfix: cache file wasn't being written if EXIF data was used directly (thanks olgradinØcheckfree*com) * Bugfix: phpThumb.demo.showpic.php was broken by popup blockers for images larger than the screen. (thanks mailØmmjaeger*com) v1.4.11 - October 11, 2004 * Changed sx/sy/sw/sh parameters to allow decimal values (>0 but <1) to represent percent of source image (thanks mordorØdefault*co*yu) * Added config_error_silent_die_on_error for no-output die on fatal errors (thanks johannesØformformat*se) * Added auto-detection of probable 'document_root' if that key is not available in $_SERVER * Bugfix: Check `which convert` failing with error message (thanks chadØchadshome*com) * Bugfix: Image cropping to invalid areas outside source image caused text output (thanks mordorØdefault*co*yu) v1.4.10 - August 22, 2004 * Bugfix: cached files not written in most cases (thanks kizerØcourtkizer*com, snuffØinbox*ru) * Bugfix: ApacheLookupURIarray() crashes in CGI mode (thanks hanskrentelØyahoo*de) * Bugfix: phpthumb_bmpfile2gd() was broken (thanks iØmindlace*net) v1.4.9 - August 9, 2004 * Bugfix: changed destination filename in RenderToFile() (thanks alextkØwalla*com) * Bugfix: problems with HTTP image source when called as an object (thanks alextkØwalla*com) v1.4.8 - August 4, 2004 * $this->error has changed to $this->errors and is now an array of strings (instead of a single string) * A lot more error conditions (invalid cache directory, etc) are now reported in $this->errors (thanks aidan*slingsbyØlineone*net) * Removed all define(CONSTANT) in the phpThumb() constructor - you can now access: - PHPTHUMB_VERSION == $this->phpthumb_version; - PHPTHUMB_OSSLASH == $this->osslash; - PHPTHUMB_ISWINDOWS == $this->iswindows; * Bugfix: Error message from apache_lookup_uri() failing under Apache2 now reported cleanly (thanks derbaffØyahoo*com) * Bugfix: missing phpthumb_functions:: class name for ImageTypeToMIMEtype() call in ExtractEXIFgetImageSize() (thanks aidan*slingsbyØlineone*net) * Bugfix: ImageTypeToMIMEtype() was broken for PHP older than v4.3.0 (thanks georg*schreiberØbatch-pc*es) * Bugfix: RenderToFile() now returns false if it fails (thanks phpthumbØsendthemtomir*com) * Bugfix: Corrupt JPEG/PNG/GIF files that failed ImageCreateFrom*() were not being passed to ImageMagick for fallback, nor passed through unmodified if IM was unavailable or failed (thanks r*chongØmogenic*net) * Bugfix: Improved backtick safe-mode limit detection (thanks 1Øadamcarrington*com) * Bugfix: EXIF thumbnails were being used as source when they should not be (thanks aidan*slingsbyØlineone*net) * Bugfix: Cached files were not being created or used properly (thanks aidan*slingsbyØlineone*net) * Bugfix: max_source_pixels not set correct on some PHP versions (thanks derbaffØyahoo*com) * Bugfix: 'down' parameter ignored for unprocessed and cached files (thanks aidan*slingsbyØlineone*net) v1.4.7 - July 27, 2004 * Included a modified version of "module.graphic.bmp.php" from getID3() [http://getid3.sourceforge.net] as "phpthumb.bmp.php" for BMP reading support without ImageMagick. It works, but it's *very* slow, especially for large images (as in 640x480 or larger). * Added check to prevent error messages when shell_exec is disabled (thanks webmasterØneester*com) v1.4.6 - July 22, 2004 * Added new section to phpthumb.config.php where you can easily specify defaults for any parameter you can set in the URL. Normally URL parameters override these default values, unless you set $PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE to false * Renamed phpthumb.config.php to phpThumb.config.php since it's part of phpThumb.php, not part of phpthumb.class.php (change of case only, will not affect Windows servers, but will affect *nix) * Changed cached filename of rawImageData-source images from urlencode('') to md5(rawImageData). This should make caching thumbnails from non-file sources more reliable. * Added ImageMagick debugging information * Removed unneccesary default values from cached filenames. This may invalidate some previously cached files. phpthumb.demo.cacheconvert.php has been updated to handle v1.4.1-1.4.5 => v1.4.6+ cache filenames. * Bugfix: Cached filename did not have file-modified datestamp when used as implmented in phpThumb.php * Bugfix: RenderToFile() now accepts relative filenames (thanks aidan*slingsbyØlineone*net) * Bugfix: AllowOutputEnlargment setting was ignored when falling back to ImageMagick * Bugfix: IgnoreAspectRatio setting was ignored when falling back to ImageMagick * Bugfix: config_temp_directory was ignored in gd_info() in PHP < v4.3.0 when phpinfo() returns no GD information (due to safe mode restrictions) (thanks mimyrtekØmyrtek*com) v1.4.5 - June 28, 2004 * Added new parameter 'down' where you can specify a filename and OutputThumbnail() will cause the file to be downloaded rather than displayed in the browser. Demo images on silisoftware.com/scripts/phpThumb/demo/ can all be downloaded to show off this feature. (thanks stuartscrumpØyahoo*co*uk) * Added ability to remove old files from cache directory based on last-access time and/or number of cached files and/or total size of cached files (thanks jrmhaigØyahoo*co*uk) * Added public CleanUpCacheDirectory() for cache cleaning (see above) if you need to call it manually * Included new file phpThumb.demo.cacheconvert.php to convert old-style cache names to the current (and hopefully last!) standard naming convention. (thanks joshgØtwcny*rr*com) * Added configuration value 'document_root' for rare case when $_SERVER['DOCUMENT_ROOT'] return incorrect value (thanks joshgØtwcny*rr*com) * Now tries to create thumbnail with ImageMagick if ImageCreateFromJPEG etc fails, before falling back to outputting unmodified source data. * Bugfix: HTTP image sources were broken (thanks fritz*weisshartØt-online*de) * Bugfix: ImageMagick callout wasn't being used if EXIF thumbnail was available (thanks joshgØtwcny*rr*com) * Bugfix: HTTP src with space in filename was broken (thanks drØrhodes360*com) * Bugfix: version_compare_replacement() was broken for PHP v4.1.0+ v1.4.4 - June 8, 2004 * Bugfix: network-share (Windows) source filenames were not possible. Now works, but you must use the network name and not a mapped drive name, for example: \\othercomputer\file.jpg - good \\192.168.2.1\file.jpg - good z:\file.jpg - won't work This is a PHP limitation (see www.php.net/file-exists) Note: you may want to use "/" slashes instead of "\" if you have magic_quotes_gpc enabled to avoid stripslashes problems. (thanks drØrhodes360*com) * Bugfix: missing "phpthumb_functions::" in ImageCreateFromStringReplacement() (thanks zapletalØsoftwaremedia*cz) v1.4.3 - May 25, 2004 * Added new configuration variable 'config_temp_directory' to allow you to specify a writable directory name for temp files if you do not have access to the system temp directory on your server (Safe Mode restrictions etc) (thanks nickØregenmag*com) * Added new configuration variable 'config_error_die_on_error' which can be set to false if you want to retrieve the error message without having it dumped as an image - the error message is now available in $phpThumb->error * Images are passed through directly with no processing and no caching if no parameters are passed to alter the image (resize, crop, sharpening, etc) (thanks nchmuraØusers*sourceforge*net) * Added new configuration variable 'config_disable_debug' which disabled phpThumbDebug from working if you have security concerns about the displayed information * Bugfix: Added detection at the top of phpThumb.php for no-GD errors to avoid parse errors later in the code (thanks nickØregenmag*com) * Bugfix: RoundedImageCorners() had some off-by-1 errors (thanks ola*thunbergØhome*se) v1.4.2 - May 10, 2004 * Added IE-compatability mode for transparent corners (set 'bct=256') * Bugfix: version_compare_replacement() was broken in PHP older than 4.1.0 (thanks nickØregenmag*com) v1.4.1.1 - May 9, 2004 * Bugfix: Removed ImageTrueColorToPalette hack. See http://bugs.php.net/bug.php?id=28341 * Bugfix: 'maxb' option for PNG/GIF output incorrect bit depth under some circumstances v1.4.1 - May 9, 2004 * Added 'maxb' (MAXimum Bytes) option to auto-set the output image quality (JPEG) or bit depth (PNG/GIF) so that the output thumbnail is less than 'maxb' bytes (thanks e_belleØhotmail*com) * Added 'bgt' parameter to make rounded corners from 'brx'/'bry' option transparent when used with PNG output. Note: PHP/GD appears buggy at this time, so this option must force output to 256-color mode for this to work. The feature will be updated when a non-broken version of PHP/GD is released. (thanks javierØircorion*net) * Bugfix: Caching was broken (thanks mikeØgdaymate*nl, jurewiczØgo3*pl) v1.4.0 - April 30, 2004 * Rewritten as a PHP class. Split into several files: - phpthumb.class.php = most processing code - phpthumb.functions.php = support functions - phpthumb.readme.txt = usage instructions - phpthumb.changelog.txt = this file - phpthumb.config.php = configuration file - phpthumb.gif.php = Non-GD GIF reading support - phpthumb.unsharp.php = Unsharp Masking support - phpThumb.php = demo script that works exactly as previous versions; this is a drop-in replacement for existing phpThumb() installations - phpThumb.demo.showpic.php = demo script that auto- resizes a popup window to the size of the image shown. Useful if you want popup images but do not know the large image size beforehand * Added optional call-out to ImageMagick (if avaible) if source image is larger than PHP memory restrictions allow. ImageMagick installation should be auto-detected under *nix, but you should configure 'imagemagick_path' for use under Windows. * 'max_source_pixels' is now auto-calculated from PHP configuration settings. Due to various server-level restrictions that may override PHP settings this calculated value may not always be correct, and you may have to specify the value manually. * Added rounded-corner border option. You must specify both 'brx' (horizontal radius) and 'bry' (vertical radius) as well as 'bw' (border width). If 'bw' is greater than zero, the image will be shrunk to fit inside the border with a margin of background color. If 'bw' is zero, the corners of the image will be cut off and filled with background color. (thanks javierØircorion*net) * Minor speed improvement for unsharp masking v1.3.7 - March 28, 2004 * Bugfix: GD version detection was broken on PHP <4.3.0 on servers where phpinfo() was disabled (thanks javierØircorion*net) * Bugfix: Non-GD GIF support was broken on restricted PHP configurations (thanks javierØircorion*net) * Bugfix: phpThumb.gif.php output error messages if PHP was running in Safe Mode * Added 'iar' parameter (Ignore Aspect Ratio) to allow non-proportional resizing (stretch image to fit). You must specify 'h' and 'w' to use this option. (thanks javierØircorion*net) v1.3.6 - March 14, 2004 * Bugfix: was broken when register_globals turned on (thanks joshgØtwcny*rr*com) * Bugfix: Images with transparent backgrounds now have the background color filled with the color specified by the 'bg' parameter * Bugfix: ImageCreateFromString() is broken in the non-bundled GD. Added workaround, but please use the bundled version of GD if possible (thanks dnØxbe*ch) * Bugfix: EXIF thumbnail caching was broken * Bugfix: EXIF thumbnail handling was broken for PHP v4.2.x (thanks smithk1Øshaw*ca) * Bugfix: Image borders with GD2 were misaligned * Bugfix: virtual paths/filenames like /~user/foo.jpg should now work properly, if PHP is installed as an Apache module (see www.php.net/apache-lookup-uri) * Bugfix: contents of any non-image file could be displayed (including PHP & HTML files) (thanks arsyanØarsyan*com) * Added rotation parameters 'ra' and 'ar' (thanks drØrhodes360*com) * Added $CONFIG['output_allow_enlarging'], defaulted to false, to prevent smaller-than-max-size images from being enlarged beyond their original size. If you want to be able to enlarge images, set this to false. Can be overridden with the 'aoe' parameter (thanks dnØxbe*ch) * Changed all configuration variables to be under one array named $CONFIG * Moved color and font options for ErrorImage() to $CONFIG variables * Changed cached filename structure (again) to a more flexible format that can handle future expansion (old cached files are invalid and will be recreated) * Added more debugging code to phpThumbDebug v1.3.5 - February 29, 2004 * Added capability to use EXIF thumbnail that may be embedded in source image (often is in digital camera JPEGs) and source image dimensions are larger than $config_max_source_pixels. This will overcome the limitation where PHP runs out of memory processing large images (usually >1600x1200). EXIF thumbnail extraction requires PHP v4.2.0 or higher and EXIF support compiled into PHP (or php_exif extension) * Eliminated intermediate read-file-to-memory stage if image is created from local file. Should allow larger images to be processed without running out of memory. * Added optional 'goto' parameter to be used with the 'file' parameter, where 'goto' is a URL that is redirected to after image is rendered to file (thanks wimbleØwebdonors*com) * Added optional 'xto' parameter that will bypass all processing and just return the embedded EXIF thumbnail, if available. * Added error-handling if ImageTypes() is unavailable v1.3.4 - February 15, 2004 * Custom error image option (&err=img.jpg) which can also be set as $config_error_message_image_default (thanks carlØ4thstar*net) * &f=text will now output plain-text error messages * ErrorImage() now used for anti-hotlink messages (if $config_nohotlink_erase_image is true) v1.3.3 - February 5, 2004 * Bugfix: Added stripslashes() to filenames if magic_quotes_gpc is enabled (thanks arsyanØarsyan*com) * Output can now be rendered to a file only (not to browser) specified by the 'file' parameter (thanks arsyanØarsyan*com) * JPEG quality now has a maximum of 95%, as specified in the GD documentation v1.3.2.1 - February 3, 2004 * Bugfix: gd_version() was broken for GD v2.0+ * Bugfix: removed debugging code v1.3.2 - February 3, 2004 * Bugfix: when borders are enabled, portait images with no width constraint, or landscape images with no height constraint were smaller than neccesary by double the border width (thanks jjjØxs4all*nl) * Added unsharp mask option thanks to Torstein Hønsi: http://www.vikjavev.com/hovudsida/umtestside.php Note: requires GD v2.x to function (thanks jjjØxs4all*nl) * Updated cache filenames to reflect new parameters, this means old cached files will need to be deleted (or not, they just will never get called again) and new cached versions will be created. * Added caching to gd_info() calls for minor speedup v1.3.1 - February 2, 2004 * Added optional border (width and color configurable) (thanks arsyanØarsyan*com) * Added option to create fixed-dimension thumbnails regardless of source aspect ration. Set the 'bw' (BorderWidth) parameter (even to 0) and this will be enabled. Outside the actual image will be filled with 'bg' color (default FFFFFF) (thanks arsyanØarsyan*com) v1.3.0 - January 27, 2004 * Added watermarking option to overlay thumbnails with a semi-transparent watermark image (copied from a seperate source watermark image) (thanks arsyanØarsyan*com) * Added option for absolute filenames (on both Windows and *nix) outside the DOCUMENT_ROOT directory * Added debug output dump for diagnosing problems) v1.2.8 - January 19, 2004 * added ability to specify relative pathnames as well as absolute pathnames (pathname is relative to the location of phpThumb.php if the passed source does not begin with "/" v1.2.7 - January 7, 2004 * Added patch to allow use of PHP older than 4.1.0 (or GD without PNG support) for non-GD GIF support (thanks hostwebserverØhotmail*com) v1.2.6 - January 4, 2004 * Added patch to allow use of PHP older than 4.1.0 (without the superglobals arrays) v1.2.5 - December 26, 2003 * Added configuration options for default output image format and max width/height v1.2.4 - December 20, 2003 * Bugfix: temp directory for non-native GD support not always returning valid directory * Caching feature reintroduced (see configuration) v1.2.3 - December 19, 2003 * Added anti-hotlink code so the thumbnail script on one domain cannot be used by another domain. The list of allowed domains defaults to the current domain but is configurable below as $config_nohotlink_valid_domains. The message, text size, colors and whether to blank the image or not are also configurable * Bugfix: URL image sources were not able to use the non-GD GIF-reading functions v1.2.2 - December 17, 2003 * Added option to use http:// URL as image source v1.2.1 - December 11, 2003 * Added option to get source data from a database rather than a physical file * Bugfix: resize not proportional when wide image limited more by max height than max width Thanks mathias_strasserØgmx*net * Removed caching code v1.2.0 - December 10, 2003 * Added GIF support for versions of GD that do not have built-in GIF support (v1.6.x) via the "GIF Util" class by Fabien Ezber (www.yamasoft.com) GD's built-in GIF-reading functions are faster, and are present in PHP v4.3.0 or newer, but all versions of GD can display resized GIF thumbnails now. v1.1.2 - October 26, 2003 * check for source image existance to prevent text error messages * if GD not available, a GIF saying "no GD" is shown instead of showing the original image * Cache feature introduced v1.1.1 - September 28, 2003 * better resize code by sfisher10Øcox*net v1.1.0 - September 1, 2003 * initial public release * thumbnails can now be larger than source image * graphical error messages v1.0.0 - January 7, 2002 * initial private release