Yii Framework Forum: [EXTENSION] EPhpThumb - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] EPhpThumb A lightweight wrapper for phpThumb Rate Topic: -----

#21 User is offline   Enrique Salazar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 29-January 13

Posted 20 February 2013 - 11:27 AM

Hi all.

I am getting this

CException

EThumbnail and its behaviors do not have a method or closure named "create". (C:\wamp\www\yii\framework\base\CComponent.php:265)

#0 C:\wamp\www\vivienda\protected\controllers\OpViviendasController.php(303): CComponent->__call('create', Array)
#1 C:\wamp\www\vivienda\protected\controllers\OpViviendasController.php(303): EThumbnail->create('C:\wamp\www\viv...')
#2 C:\wamp\www\yii\framework\web\actions\CInlineAction.php(49): OpViviendasController->actionUploadfoto()
#3 C:\wamp\www\yii\framework\web\CController.php(308): CInlineAction->runWithParams(Array)
#4 C:\wamp\www\yii\framework\web\filters\CFilterChain.php(133): CController->runAction(Object(CInlineAction))
#5 C:\wamp\www\yii\framework\web\filters\CFilter.php(40): CFilterChain->run()
#6 C:\wamp\www\yii\framework\web\CController.php(1145): CFilter->filter(Object(CFilterChain))
#7 C:\wamp\www\yii\framework\web\filters\CInlineFilter.php(58): CController->filterAccessControl(Object(CFilterChain))
#8 C:\wamp\www\yii\framework\web\filters\CFilterChain.php(130): CInlineFilter->filter(Object(CFilterChain))
#9 C:\wamp\www\yii\framework\web\CController.php(291): CFilterChain->run()
#10 C:\wamp\www\yii\framework\web\CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#11 C:\wamp\www\yii\framework\web\CWebApplication.php(282): CController->run('uploadfoto')
#12 C:\wamp\www\yii\framework\web\CWebApplication.php(141): CWebApplication->runController('opViviendas/upl...')
#13 C:\wamp\www\yii\framework\base\CApplication.php(169): CWebApplication->processRequest()
#14 C:\wamp\www\vivienda\index.php(13): CApplication->run()
#15 {main}


the main...

'components' => array(
        'phpThumb' => array(
            'class' => 'ext.EPhpThumb.EPhpThumb',
//    'options'=>array(optional phpThumb specific options are added here)
        ),


the controller...

          $thumb = Yii::app()->phpThumb->create($folder . $result['filename']);
                $thumb->create($folder . $result['filename']);
                $thumb->resize(100, 100);
                $thumb->save($folder . "thumb\\" . $result['filename']);


Ive tried everything, I am pretty sure is something easy to solve but I cant just figure it out yet.

Thanks.

pd.

I am using WAMP 2.2 PHP 5.4.3 Apache 2.4.2

gd
GD Support 	enabled
GD Version 	bundled (2.0.34 compatible)
FreeType Support 	enabled
FreeType Linkage 	with freetype
FreeType Version 	2.4.6
T1Lib Support 	enabled
GIF Read Support 	enabled
GIF Create Support 	enabled
JPEG Support 	enabled
libJPEG Version 	6b
PNG Support 	enabled
libPNG Version 	1.2.46
WBMP Support 	enabled
XBM Support 	enabled 

0

#22 User is offline   Haensel 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 444
  • Joined: 14-January 11
  • Location:Vienna (Austria)

Posted 20 February 2013 - 11:37 AM

You are trying to create a thumb from a thumb which is not possible. Try this

$thumb = Yii::app()->phpThumb->create($folder . $result['filename']);
//$thumb->create($folder . $result['filename']); this line is wrong, so delete it
$thumb->resize(100, 100);
$thumb->save($folder . "thumb\\" . $result['filename']);

0

#23 User is offline   Enrique Salazar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 29-January 13

Posted 20 February 2013 - 11:58 AM

View PostHaensel, on 20 February 2013 - 11:37 AM, said:

You are trying to create a thumb from a thumb which is not possible. Try this

$thumb = Yii::app()->phpThumb->create($folder . $result['filename']);
//$thumb->create($folder . $result['filename']); this line is wrong, so delete it
$thumb->resize(100, 100);
$thumb->save($folder . "thumb\\" . $result['filename']);



working!

I had some error, tried the without main.php configuration (thats when I put that line) now I got back removing that line and everything works fine.

At least is working. Thank you very much!
0

#24 User is offline   channasmcs 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 06-March 13
  • Location:Srilanka

Posted 30 June 2013 - 10:56 PM

public function actionCreate()
{

$model=new CategoryPlaces;


// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);




if(isset($_POST['CategoryPlaces']))
{
$model->attributes=$_POST['CategoryPlaces'];
$rnd = rand(0,9999);
$uploadedFile=CUploadedFile::getInstance($model,'image');
// random number + file name
$fileName = "{$rnd}-{$uploadedFile}";
// get image with Number
$model->image = $fileName;
//$thumb=Yii::app()->phpThumb->create($uploadedFile);
// $thumb->resize(100,100);



$thumb = Yii::app()->phpThumb->create(Yii::app()->baseUrl.'/images/'.$model->image);
$thumb->resize(128,128);
// $thumb->save(Yii::app()->baseUrl.'/images/articoli/thumbnails/thumb_'.$model->image);



i have erorr like this
Alias "ext.EPhpThumb.EPhpThumb" is invalid. Make sure it points to an existing PHP file and the file is readable.

please help......?
0

#25 User is offline   jhejhekukuzaizai 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 11-July 13

Posted 30 July 2013 - 02:12 AM

excuse me, i want to know where will i place my ephpthumb in my app. thanks.. please feedback.
0

#26 User is offline   Oliver Sept 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 29-November 13

Posted 29 November 2013 - 11:15 AM

Hi, guys.

Can you please help me?! Where should I paste this lines to?

$thumb=Yii::app()->phpThumb->create('../images/myImage.jpg');
$thumb->resize(100,100);
$thumb->save('../images/thumb.jpg');


when I put this code into config/main.php, I get this messages:

( ! ) Fatal error: Uncaught exception 'CException' with message 'Property "CWebApplication.phpThumb" is not defined.' in C:\wamp\framework\base\CComponent.php on line 130
( ! ) CException: Property "CWebApplication.phpThumb" is not defined. in C:\wamp\framework\base\CComponent.php on line 130


Without this code I get another message:

move_uploaded_file(assets/pic/raw/24432_414865008596494_436127221_n.jpg): failed to open stream: No such file or directory

Help me! :blink:
0

#27 User is offline   rosinghal 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 05-March 13
  • Location:India

Posted 13 February 2014 - 01:53 AM

Is there any option to compress the image?
Xtendify - A marketplace for plugins and themes.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users