But I have some doubts:
1: Why in the official APIs is it labeled as "deprecated?
https://api.joomla.org/cms-3/classes/Jo ... eateThumbs
Are there new methods to do it?
2: Why is there so little documentation and so many third party extensions if it's possible to use core framework to make thumbnails?
3: Any developer/coder can tell me how to manage jpg compression with createThumbs()?
Code: Select all
// PATH
$image = new JImage(JPATH_BASE."/".$images->image_intro);
// SIZES ARRAY
$sizes = array('300x300', '500x500', '800x800');
// PATH THUMBNAIL
$thumb_image_path = pathinfo($images->image_intro)['dirname']."/thumbs/".pathinfo($images->image_intro)['filename']."_".$sizes[0].".".pathinfo($images->image_intro)['extension'];
// IF FILE DOES NOT EXIST...
if (!JFile::exists(getcwd()."/".$thumb_image_path)) {
// CREATE THE THUMBS
$thumb_image = $image->createThumbs($sizes, JImage::CROP_RESIZE);
}