About pThumb

A fork of phpThumbOf. pThumb is a drop-in replacement for phpThumbOf and fixes many of its issues, adds a few new features, and improves performance.


January 18, 2014

Supported Database
MySQL, SQL Server


Supported Versions
2.2 - Current



pThumb uses the same namespace, settings and snippet name as phpThumbOf, so after it's installed any code using phpThumbOf will automatically use the new version instead.

Uninstall phpThumbOf before installing pThumb.

(You don't have to uninstall phpThumbOf first, but it makes things less confusing. If you uninstall phpThumbOf later, you'll have to reinstall pThumb.)

New in 2.3.0-pl

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 jpeg_quality 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['DOCUMENT_ROOT'] != MODX_BASE_PATH
  • [#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.cache_url 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 new_file_permissions 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.jpeg_quality global default JPEG quality setting
  • [#46] add phpthumbof.check_mod_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

View | Download
June 14, 2014
2.2 - Current

View | Download
May 26, 2014
2.2 - Current

View | Download
March 23, 2014
2.2 - Current

View | Download
January 18, 2014
2.2 - Current

View | Download
December 6, 2013
2.2 - Current