Problem s Nette\Utils\Image
- Tomas8698
- Člen | 109
Ešte mam jeden problem, v resp. neviem ci som funkciu na vyhladanie fromFile pochopil spravne, potrebujem na zaklade informacie z url najst obrazok a zmenit velkost. Ale ked prejdem na stranku tak mi vypise ze:
Unknown type of file '/home/tomas/Plocha/gallery/www/AllGalleries/name/asds.jpg'.
public function actionDefault($width, $height , $fullPath){
$dir = dirname(__DIR__ ,2);
$pathAllGallery = $dir.'/www/AllGalleries';
$image = glob($pathAllGallery."/*/".$fullPath.".{jpg,png,gif}", GLOB_BRACE);
if (count($image) !== 0){
$thisImage = Image::fromFile($image.".jpg");
if($width>0 && $height >0){
$thisImage->resize($width, $height);
}
elseif ($width === 0 ){
$thisImage->resize(null, $height);
}
elseif($height === 0){
$thisImage->resize($width, null);
}
Neviete kde by mohla byt chyba?
Editoval Tomas8698 (6. 10. 2021 18:45)