jrbasso/MeioUpload

phpThumb error

rubyistdotjs opened this issue · 1 comments

Like 15 minutes ago, I came here for expose a phpThumb error.
When trying to explain my problem, I found the answer ...

So I post it for helping others who have the same problem, and of course for warn the developers of this plugin.

I had this phpThumb error :

phpThumb() v1.7.11-201108081537
http://phpthumb.sourceforge.net

Error messages disabled

First, I noticed an error on line 847 in 'MeioUpload/Model/Behavior/MeioUploadBehavior.php' :

$thumbSaveAs = WWW_ROOT . DIRECTORY_SEPARATOR . $thumbSaveAs;

the directory separator constant is already set in the WWW_ROOT in /index.php line 30 :

define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);

I replaced it.
And then I added in function _createThumbnail : :

$phpThumb->config_disable_debug = false;

for output the PHPThumb error.
Here I saw (I'm on Mac os x) :

"/Users/me/Sites/cake/app/Vendor/phpThumb/uploads/myModel/myFile.jpg" does not exist

well, the error came from the $saveAs variable.
So I added after the line 847 in 'MeioUpload/Model/Behavior/MeioUploadBehavior.php' :

$saveAs = WWW_ROOT.$saveAs;

Fixed

This is probably not the good place for correct the saveAs variable but for now its works fine.

I use CakePHP 2.0.4
Sorry for my bad english

Tnx your solution worked for me.