Yii Framework Forum: Image resize extension problem ?? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Image resize extension problem ?? Rate Topic: -----

#1 User is offline   Rohit.28f 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 11-August 11
  • Location:Bangalore,INDIA

Posted 27 September 2011 - 04:31 AM

Hi guys i m using image extension of yii for image resizing i have morzilla6.0,php 5.0,yii1.1.6,windows OS
i followed these steps.........
1-downloaded and extracted image extension zipfolder in protected/extension/
2-in config main file
'import'=>array(
'application.helpers.*', ),


in component section of main file
'components'=>array(
'image'=>array(
'class'=>'application.extensions.image.CImageComponent',
// GD or ImageMagick
'driver'=>'GD',
// ImageMagick setup path
'params'=>array('directory'=>'http://121.242.65.82:8087/protected/extensions/image/drivers'), // path to image_Imagemagic or image //_GD_driver files>>>>>

),

3-in a view file code is


Yii::import('application.extensions.image.Image');
$image
= new Image('http://121.242.65.82:8087/images/g2.jpg');
$image
->resize(400, 100)->rotate(-45)->quality(75)->sharpen(20);
$image
->render();


in morzill browser getting error

image not found
if ($check === FALSE)
74 throw new CException('image getimagesize missing');
75
76 // Check to make sure the image exists
77 //echo $image;exit;
78 if ( ! is_file($image))
79 throw new CException('image file not found');
80
81 // Disable error reporting, to prevent PHP warnings


i have checked image is in this path???? plz help me ???

0

#2 User is offline   PrimoDrago 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 17-February 13

Posted 06 May 2013 - 04:26 PM

Your problem has to be in:

$image = new Image('..//.../g2.jpg');

Because the first thing the extension does is to validate the url with the code:

'file' => str_replace('\\', '/', realpath($image))

Make sure you are not giving an absolute url to the constructor.
0

Share this topic:


Page 1 of 1
  • 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