I'm trying to resize sample image and save it, using Image extension with ImageMagick, platform WINXP
here is resize code:
Quote
$image = Yii::app()->image->load('c:/1.jpg');
/*@var $image Image */
$image->resize(400,300);
$image->save();
/*@var $image Image */
$image->resize(400,300);
$image->save();
config code:
Quote
...
'image'=>array(
'class'=>'application.extensions.image.CImageComponent',
// GD or ImageMagick
'driver'=>'ImageMagick',
// ImageMagick setup path
'params'=>array('directory'=>'C:/Program Files/ImageMagick/'),
),
'image'=>array(
'class'=>'application.extensions.image.CImageComponent',
// GD or ImageMagick
'driver'=>'ImageMagick',
// ImageMagick setup path
'params'=>array('directory'=>'C:/Program Files/ImageMagick/'),
),
While executing resize action, i
get PHP error
Quote
Description
unlink(k2img--b73cbdf48c46ec2cbde88b5c3715f7ee09babf10.JPG) [<a href='function.unlink'>function.unlink</a>]: No such file or directory
Source File
C:\root\rus\www\protected\extensions\image\drivers\ImageMagick.php(112)
00100: header('Content-Type: image/gif');
00101: break;
00102: case 'png':
00103: header('Content-Type: image/png');
00104: break;
00105: }
00106: echo $contents;
00107: }
00108: }
00109: }
00110:
00111: // Remove the temporary image
00112: unlink($this->tmp_image);
00113: $this->tmp_image = '';
00114:
00115: return $status;
00116: }
00117:
00118: public function crop($prop)
00119: {
00120: // Sanitize and normalize the properties into geometry
00121: $this->sanitize_geometry($prop);
00122:
00123: // Set the IM geometry based on the properties
00124: $geometry = escapeshellarg($prop['width'].'x'.$prop['height'].'+'.$prop['left'].'+'.$prop['top']);
Stack Trace
#0 C:\root\rus\www\protected\extensions\image\drivers\ImageMagick.php(112): unlink()
#1 C:\root\rus\www\protected\extensions\image\Image.php(334): Image_ImageMagick_Driver->process()
#2 C:\root\rus\www\protected\controllers\SiteController.php(113): Image->save()
#3 C:\root\yii\framework\web\actions\CInlineAction.php(32): SiteController->actionImage()
#4 C:\root\yii\framework\web\CController.php(300): CInlineAction->run()
#5 C:\root\yii\framework\web\CController.php(278): SiteController->runAction()
#6 C:\root\yii\framework\web\CController.php(257): SiteController->runActionWithFilters()
#7 C:\root\yii\framework\web\CWebApplication.php(332): SiteController->run()
#8 C:\root\yii\framework\web\CWebApplication.php(120): CWebApplication->runController()
#9 C:\root\yii\framework\base\CApplication.php(133): CWebApplication->processRequest()
#10 C:\root\rusdom2000\www\index.php(11): CWebApplication->run()
unlink(k2img--b73cbdf48c46ec2cbde88b5c3715f7ee09babf10.JPG) [<a href='function.unlink'>function.unlink</a>]: No such file or directory
Source File
C:\root\rus\www\protected\extensions\image\drivers\ImageMagick.php(112)
00100: header('Content-Type: image/gif');
00101: break;
00102: case 'png':
00103: header('Content-Type: image/png');
00104: break;
00105: }
00106: echo $contents;
00107: }
00108: }
00109: }
00110:
00111: // Remove the temporary image
00112: unlink($this->tmp_image);
00113: $this->tmp_image = '';
00114:
00115: return $status;
00116: }
00117:
00118: public function crop($prop)
00119: {
00120: // Sanitize and normalize the properties into geometry
00121: $this->sanitize_geometry($prop);
00122:
00123: // Set the IM geometry based on the properties
00124: $geometry = escapeshellarg($prop['width'].'x'.$prop['height'].'+'.$prop['left'].'+'.$prop['top']);
Stack Trace
#0 C:\root\rus\www\protected\extensions\image\drivers\ImageMagick.php(112): unlink()
#1 C:\root\rus\www\protected\extensions\image\Image.php(334): Image_ImageMagick_Driver->process()
#2 C:\root\rus\www\protected\controllers\SiteController.php(113): Image->save()
#3 C:\root\yii\framework\web\actions\CInlineAction.php(32): SiteController->actionImage()
#4 C:\root\yii\framework\web\CController.php(300): CInlineAction->run()
#5 C:\root\yii\framework\web\CController.php(278): SiteController->runAction()
#6 C:\root\yii\framework\web\CController.php(257): SiteController->runActionWithFilters()
#7 C:\root\yii\framework\web\CWebApplication.php(332): SiteController->run()
#8 C:\root\yii\framework\web\CWebApplication.php(120): CWebApplication->runController()
#9 C:\root\yii\framework\base\CApplication.php(133): CWebApplication->processRequest()
#10 C:\root\rusdom2000\www\index.php(11): CWebApplication->run()
Temp file with name "k2img--b73cbdf48c46ec2cbde88b5c3715f7ee09babf10.JPG" exists on disk C... Kinda weird it can't remove it..
Any advise ?

Help















