Skip to content

Commit

Permalink
v2.3.0-beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
oo12 committed Dec 22, 2013
1 parent 1f4d20b commit c3096ee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pThumb 2.2.1-pl
pThumb 2.2.2-pl2
==========

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.
Expand Down Expand Up @@ -81,7 +81,7 @@ Note: Switching cache systems won't migrate your cached images from one cache to

### No Amazon S3

Version 2.0 drops support for AWS. I don't use or know much about it 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.
Version 2.2 doesn’t support S3, but 2.3 will. If you’d like to test it, download the transport package, read the [instructions](https://github.com/oo12/phpThumbOf/wiki/Amazon-S3), and be sure to report any bugs or other thoughts [here](https://github.com/oo12/phpThumbOf/issues/3).


Changes from phpThumbOf 1.4.0
Expand Down
4 changes: 2 additions & 2 deletions _build/config/phpthumbof.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
'packageName' => 'pThumb', /* No spaces, no dashes */
'packageNameLower' => 'phpthumbof',
'packageDescription' => 'A better phpThumbOf',
'version' => '2.2.2',
'release' => 'pl2',
'version' => '2.3.0',
'release' => 'beta1',
'author' => 'Jason Grant',
'email' => '',
'authorUrl' => 'https://github.com/oo12',
Expand Down
7 changes: 7 additions & 0 deletions core/components/phpthumbof/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
pThumb
======

2.3.0-beta1 [22.12.2013]
------------------------

- [#3] Add Amazon S3 support
- Improve naming for remote files


2.2.2-pl2 [06.12.2013]
---------------------

Expand Down
8 changes: 4 additions & 4 deletions core/components/phpthumbof/model/phpthumbof.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,15 @@ public function createThumbnail($src, $options) {
return $cacheUrl;
}

if ($this->config['use_ptcache'] && !is_writable($cacheFilenamePath)) {
if ($this->config['use_ptcache'] && !is_writable($cacheFilenamePath)) { // make sure pThumb cache location exists
if ( !$this->modx->cacheManager->writeTree($cacheFilenamePath) ) {
$this->modx->log(modX::LOG_LEVEL_ERROR, "[pThumb] Cache path not writable: $cacheFilenamePath");
return $src;
}
}

if ($this->config['useResizer']) {
/* Generate Thumbnail */
if ($this->config['useResizer']) { // use Resizer
static $resizer_obj = array();
if (!class_exists('Resizer')) { // set up Resizer. We'll reuse this object for any subsequent images on the page
if (!$this->modx->loadClass('Resizer', MODX_CORE_PATH . 'components/resizer/model/', true, true)) {
Expand All @@ -304,7 +305,7 @@ public function createThumbnail($src, $options) {
$this->phpThumb = $resizer_obj[0];
$writeSuccess = $this->phpThumb->processImage($this->input, $cacheKey, $ptOptions);
}
else { //use phpThumb
else { // use phpThumb
if (!class_exists('phpthumb', FALSE)) {
if (!$this->modx->loadClass('phpthumb', MODX_CORE_PATH . 'model/phpthumb/', true, true)) {
$this->debugmsg('Could not load phpthumb class.');
Expand Down Expand Up @@ -338,7 +339,6 @@ public function createThumbnail($src, $options) {
return $src;
}
$writeSuccess = $this->phpThumb->RenderToFile($cacheKey);
$this->phpThumb = null;
}

if ($writeSuccess) { // write it to the cache file
Expand Down
Binary file added pthumb-2.3.0-beta1.transport.zip
Binary file not shown.

0 comments on commit c3096ee

Please sign in to comment.