Here is how to resize images by width and height, but images (portret and lanscape) will keep ratio/proportions.
And images in Blog layout will allways have same dimensions in px (for instance, all images will be 150 px width X 100px height.)
Just tested and it works perfectly.
Decide width and height in px, then new thing is background-color for part of image block that is over.
So, black color will be top-bottom or left-right, in relation to pictures, depending if you have landscape or some picture with great height. (you can use any color you want)
And chose everything below to suit your needs (tex,S,L,XL)
//Medium image $handle->image_resize = true; $handle->image_ratio = true; $handle->image_convert = 'jpg'; $handle->image_ratio_fill = true; $handle->image_background_color = '#000000'; $handle->jpeg_quality = $params->get('imagesQuality'); $handle->file_auto_rename = false; $handle->file_overwrite = true; $handle->file_new_name_body = $filename.'_M'; if (JRequest::getInt('itemImageM')) { $imageWidth = JRequest::getInt('itemImageM'); } else { $imageWidth = $params->get('itemImageM', '100'); } if (JRequest::getInt('itemImageM_Height')) { $imageHeight = JRequest::getInt('itemImageM_Height'); } else { $imageHeight = $params->get('itemImageM_Height', '115'); } $handle->image_x = $imageWidth; $handle->image_y = $imageHeight; $handle->Process($savepath);
And images in Blog layout will allways have same dimensions in px (for instance, all images will be 150 px width X 100px height.)
Just tested and it works perfectly.
Decide width and height in px, then new thing is background-color for part of image block that is over.
So, black color will be top-bottom or left-right, in relation to pictures, depending if you have landscape or some picture with great height. (you can use any color you want)
And chose everything below to suit your needs (tex,S,L,XL)
//Medium image $handle->image_resize = true; $handle->image_ratio = true; $handle->image_convert = 'jpg'; $handle->image_ratio_fill = true; $handle->image_background_color = '#000000'; $handle->jpeg_quality = $params->get('imagesQuality'); $handle->file_auto_rename = false; $handle->file_overwrite = true; $handle->file_new_name_body = $filename.'_M'; if (JRequest::getInt('itemImageM')) { $imageWidth = JRequest::getInt('itemImageM'); } else { $imageWidth = $params->get('itemImageM', '100'); } if (JRequest::getInt('itemImageM_Height')) { $imageHeight = JRequest::getInt('itemImageM_Height'); } else { $imageHeight = $params->get('itemImageM_Height', '115'); } $handle->image_x = $imageWidth; $handle->image_y = $imageHeight; $handle->Process($savepath);
