Creator: jgrant (jgrant)

2.3.3-pl (631 KB) Other Versions


About pThumb

A fork of phpThumbOf 1.4.0.  pThumb is a lightweight, efficient, and actively maintained replacement for phpThumbOf.  It offers most of the functionality of its predecessor while adding new features, fixing bugs, and offering some potentially dramatic speed improvements on sites which use phpThumbOf heavily.

See the GitHub page for more details.

Significant New Features

  • Resizer — A leaner, faster alternative to phpThumb for image sizing and cropping. Added in version 2.0.
  • pThumb Cache — Cleaner, more semantic and SEO-friendly image URLs.  Added in version 2.1.
  • Improved Amazon S3 support
  • Ability to output image width and height
  • Improved cache cleaner plugin


June 14, 2014
Supported Versions
2.2 – Current
Supported Database
MySQL, Microsoft SQL Server

New in pThumb 2.3.3

2.3.3-pl [14.06.2014]

  • [#23] Fix cache cleaner to delete pngs and gifs from phpthumbof cache (hat tip Ian Brindley)

2.3.2-pl [26.05.2014]

  • [#20] Fix PHP error when running in mgr context (hat tip exside)
  • [#21] Better error messages when input is a directory (hat tip exside)
  • Make pThumb cache cleaning more selective
  • Update Resizer to 1.0.1-pl

2.3.1-pl [23.03.2014]

  • [#18] Improve support for context settings (httphost and baseurl)
  • Add options to return image dimensions (toPlaceholder property and dims option)
  • Update Resizer to 0.5.1-pl
  • Several small bug fixes and improvements

2.3.0-pl [18.01.2014]

  • [#3] Add Amazon S3 support
  • Improve naming and cache structure for remote files
  • [#17] Fix file paths when using phpThumb on Windows
  • Add a small optimization for phpThumb

2.2.2-pl2 [06.12.2013]

  • [#13] Correct for any inaccurate paths caused by context settings
  • [#14] Fix handling of phpThumb fltr parameter
  • [#16] Fix handling of paths when MODX is running from a subdirectory

2.2.1-pl [13.11.2013]

  • [#10] Fix an incompatibility with the cache manager and PHP < 5.3

2.2.0-pl [10.11.2013]

Note: v2.2 has a new hash generation algorithm for cache filenames. After you update, cache images will be regenerated on access.

  • Improve cache manager plugin; add Clean Level system setting
  • Replace jpegquality setting with a more flexible global default options setting
  • Add several small optimizations for phpThumb
  • Improve input filename checking, handling of a corner case with remote images
  • Update Resizer to 0.4.1-pl
  • [#4] Try to avert problems when $SERVER['DOCUMENTROOT'] != MODXBASEPATH
  • [#5] Honor relevant MODX phpThumb system settings
  • [#7] Change hash generation so thumbnails are specific to phpThumb or Resizer and switching between the two returns a thumbnail generated by that library, without having to clear an existing version from the cache first.
  • [#8] Add the phpthumbof.cacheurl setting back
  • [#9] Improve debug message when a thumbnail is already cached

2.1.0-pl2  [06.10.2013]

  • Update Resizer to v0.4.0-pl


  • Add a 'pThumb Cache' option. With this enabled, cached images aren't lumped into one flat directory but put into the cache in subdirectories which mirror part of the original image's path. The hash added to filenames is also much shorter. End result: cleaner, more semantic and SEO-friendly image URLs. See the documentation for more on configuring and enabling it.
  • Several performance optimizations, including one when using phpThumb.
  • Add pthumb snippet. It's the same as phpthumbof, only shorter to type :-)


  • Improve handling of paths, URLs and remote images
  • [#2] Fix newfilepermissions setting
  • Update Resizer to v0.3.1-pl
  • Several minor bug fixes


  • Update Resizer to v0.2.0-rc1, now a separate transport package.
  • [#1] Fix protocol-relative URLs for remote images
  • Fix &useResizer and &debug properties
  • Several minor speed and efficiency improvements


  • Add Resizer v0.1, a light-weight modern alternative to phpThumb. Resizer is built on Imagine, supports the Gmagick, Imagick and GD extensions and is considerably faster than phpThumb for scaling/cropping operations. Plus all the ZC options now work with GD. Enable in System Settings. Requires PHP 5.3 or higher.
  • Fix a PHP warning the phpThumbOfCacheManager plugin was throwing.


  • Major refactor for improved efficiency, especially when used multiple times on a page or when an image is already cached.
  • Remove Amazon S3 support. I don't use or know much about this and rather than release completely untested and possibly broken code, I took it out.  If you'd like it added back and are interested in helping, please get in touch.
  • Improve remote image handling. Originals are now downloaded to the cache to greatly speed up future access.
  • Improve debugging output, including easy access to the phpThumb debug messages created when a thumbnail is generated (new &debug property for phpThumbOf).


  • Add resource id # to error log message to make finding problem images easier


Initial version.  pThumb addresses the following open phpThumbOf issues:

  • [#37] Add a phpthumbof.jpegquality global default JPEG quality setting
  • [#46] add phpthumbof.checkmod_time option to refresh the cached image if the original has been modified
  • [#44] [#49] Prevent generation of identical images when the same image is used in multiple resources
  • [#48] [#49] Fix duplication of images with identical names in different directories
  • [#47] Exit quickly and silently when called with no file name
  • [#52] Make input file name handling more robust, particularly when MODX is install in a subdirectory
  • [#53] Trim extension properly
  • [#54] [#50] Fix cache cleaning


Current Releases

June 14, 2014
2.2 – Current
May 26, 2014
2.2 – Current
March 23, 2014
2.2 – Current
January 18, 2014
2.2 – Current
December 5, 2013
2.2 – Current
View Deprecated Releases

More from jgrant



Imagine image resizer for MODX.



The Image Slenderizer.Tired of clients junking up content areas and…



setPlaceholders combines the usefulness of placeholders—which are…