Answer the question
In order to leave comments, you need to log in
How to generate Joomla JImage thumbnails?
In the content output category ( com_content\category) I go through a foreach loop
<?php foreach ($this->lead_items as &$item) :
$pathToImage = $item->jcfields[5]->rawvalue; //получаю изображение из дополнительного поля
?>
<?php endforeach; ?>
$image = new JImage( $pathToImage );
$image->resize(100, 100, false, JImage::SCALE_INSIDE );
$image->toFile( $path, $type, array( 'quality'=>70 ) );
Answer the question
In order to leave comments, you need to log in
This piece of code is painfully similar to imageMagic:
$image = new JImage( $pathToImage );
$image->resize(100, 100, false, JImage::SCALE_INSIDE );
$image->toFile( $path, $type, array( 'quality'=>70 ) );
$image = new Imagick('image.jpg');
$image->resizeImage(400, 300, Imagick::FILTER_LANCZOS, 1);
$image->writeImage('image_new.jpg');
$image->destroy();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question