[EXTENSION] EPhpThumb A lightweight wrapper for phpThumb
#1
Posted 25 January 2012 - 10:51 AM
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.
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#2
Posted 26 January 2012 - 09:44 AM
#3
Posted 26 January 2012 - 10:11 AM
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#4
Posted 30 March 2012 - 11:03 AM
right into the main array configuration or some sub array as import, modules or components?
when using the configuration in the main, when trying to use the controller
$ thumb = Yii :: app () -> phpThumb-> create (.. / images / site / news / sample.jpg ');
I get the message:
The property "CWebApplication.phpThumb" is not defined.
and if I use the import
Yii :: import ("ext.EPhpThumb.EPhpThumb");
$ thumb = new EPhpThumb ();
$ thumb-> init () / / this is needed
/ / chain functions
$ thumb-> create ('.. / images / big.jpg');
$ thumb-> resize (200,200);
$ thumb-> save ('.. / images / small.jpg');
the message is
EPhpThumb and Its behaviors of the method or not have a closure named "resize".
#5
Posted 04 April 2012 - 04:00 AM
Did you put the phpThumb config within the "components" config part in your main?
"components"=>array(
...components like user, logRoutes etc.....
'phpThumb'=>array(
'class'=>'ext.EPhpThumb.EPhpThumb',
),
)
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#6
Posted 04 September 2012 - 06:53 PM
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
Any suggestions?
Thanks
#7
Posted 05 September 2012 - 09:39 AM
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#8
Posted 05 September 2012 - 04:10 PM
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.
Viil
Haensel, on 05 September 2012 - 09:39 AM, said:
#9
Posted 06 September 2012 - 11:34 AM
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#10
Posted 06 September 2012 - 04:06 PM
Thank you Haensel
Haensel, on 06 September 2012 - 11:34 AM, said:
#11
Posted 07 September 2012 - 05:44 AM
I need resize big image like this:
$thumb->resize(610,246);
My image change width to 610px and height to 610px
This extension resize only quadrat images?
That would be able to change the rectangle?
#12
Posted 07 September 2012 - 07:12 AM
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#13
Posted 07 September 2012 - 08:15 AM
$thumb=Yii::app()->phpThumb->create($images_path . '/'. $model->name); $thumb->resize(610,246); $thumb->save($images_path . '/'. $model->name);
If use
$thumb->adaptiveResize(610,246)it's good size but image it's cropped
#14
Posted 07 September 2012 - 10:30 AM
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#15
Posted 10 September 2012 - 02:26 AM
#16
Posted 10 September 2012 - 08:38 AM
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#17
Posted 13 October 2012 - 06:42 AM
Haensel, on 04 April 2012 - 04:00 AM, said:
Did you put the phpThumb config within the "components" config part in your main?
"components"=>array(
...components like user, logRoutes etc.....
'phpThumb'=>array(
'class'=>'ext.EPhpThumb.EPhpThumb',
),
)Hi Haensel
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!
#18
Posted 13 October 2012 - 11:57 AM
Btw.: 755 will only make sense if the owner of the folder is the webserver process (e.g.: www-data)
My extensions:
ActiveResource for Yii - the RESTful equivalent to ActiveRecord | Neo4Yii - wrapper for the Neo4j graph database | EPhpThumb - a simple, lightweight wrapper for the phpThumb library
Get social:
Circle me on Google Plus
Follow me on Twitter
#19
Posted 05 November 2012 - 04:01 AM
I'm trying to use ephpthumb extension.
After editing the config/main.php file and put the code below in my controller - create action like this:
$thumb = Yii::app()->phpThumb->create(Yii::app()->baseUrl.'/images/articoli/'.$model->image); $thumb->resize(128,128); $thumb->save(Yii::app()->baseUrl.'/images/articoli/thumbnails/thumb_'.$model->image);
I get this CException:
Quote
I think (of course) I have to put EPhpThumb in /extension but which files?
Thaank you
EDIT: resolved just copying the EPhpThumb folder in /extension
#20
Posted 05 December 2012 - 09:39 AM

Help
















