32 $modifier = $exactDimentions ?
'!' :
'>';
36 $width = $width == 0 ?
'' : $width ;
37 $height = $height == 0 ?
'' : $height ;
40 $cmd .=
' -scale "'. $width .
'x'. $height . $modifier ;
65 list($w,$h) = $p->getInfo($p->
getSource());
75 $p->resize($w, $h)->crop($width, $height);
90 function onTheFly(
phmagick $p,$imageUrl, $width, $height, $exactDimentions =
false, $webPath =
'', $physicalPath=
''){
92 $basePath = str_replace($webPath,$physicalPath, dirname($imageUrl) );
93 $sourceFile = $basePath .
'/'. basename($imageUrl); ;
96 $thumbnailFile = $basePath .
'/'.$width .
'_' . $height .
'_' . basename($imageUrl) ;
98 $P->setSource($sourceFile);
101 if (! file_exists($thumbnailFile)){
102 $p->resize($p,$width, $height, $exactDimentions);
105 if (! file_exists($thumbnailFile)){
107 $thumbnailFile = $sourceFile;
111 return str_replace($physicalPath, $webPath, $thumbnailFile );