EPhpThumb is a lightweight extension for the well known phpThumb library (PhpThumb). There are a lot of extensions out there providing more functionality but they can be total overkill for just creating some thumbnails and saving them to disk. I had this problem so I simply created this extension and want to share it with the Yii community.
If you experience any difficulties, bugs or have some questions post them in here.
I am using the EPhpThumb extension, and it was working well on both localhost and my test server, but literally over night it stopped working on localhost (WAMP set up) and I got the following error message:
include_once([my yii app path]\protected\extensions\EPhpThumb\lib\phpThumb\src\thumb_plugins\_notes) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: Permission denied
On my dev server (identical LAMP set up as the test server where it works) I get the following error:
include_once([my yii app path]/protected/extensions/EPhpThumb/lib/phpThumb/src/thumb_plugins/_notes) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: Invalid cross-device link
My localhost has no partitions, and both the dev and test servers are shared linux hosted servers. I just find it strange that the code works on test, not on dev, and did work for a while on localhost. The code is of course identical. I am including EPhpThumb in the controller, not in the config file.
That was it! I removed the "_notes" directories which as you said probably were put in by dreamweaver and were hidden by several of the tools I used for viewing the file hierarchy. EPhpThumb is now working perfectly again on all three servers.
That’s usually only the case when using $thumb->adaptiveResize(x,y) so I don’t understand why the above example isn’t working. Maybe you could post all your code you are using in here?
The cropping is intended if you’re using adaptiveResize() but if you are only using resize() this should not happen. The only thing I can imagine now is that this has to do with the size of the image itself so what’s the size of your original image in terms of width and height?
I am not sure what I am doing wrong; I have placed the phpThumb within components in main.php; I can now choose the ePHPThumb widget and specify the folder where images should be stored (tried the default location and other folders with permission 755).Users can choose and upload images to their profile (images ARE stored on server), but no one can actually see the images. I am not even getting any error even when uploading images.
What could have missed, since images are not visible? Thanks!
Could you please post your code (the part where you are using phpThumb to save the images) because I am not sure what you mean. You don’t see the image files or the image files don’t render in browsers?
Btw.: 755 will only make sense if the owner of the folder is the webserver process (e.g.: www-data)