Hi, in my case I was experiencing looong wait times and finally an error upon maximum execution time limit reached. I've looked at the code and analyzed what was being carried out, and it seemed that the issue happens when a small image has to be resized to a bigger size to match the XL, L, M sizes and so on.
So I edited the administrator/com_k2/models/item.php file, to ensure that the images are resized when they are bigger than the target size, and just save a copy under the jpg quality, without resizing, on any other case.
It worked okay after that. Although I can see that there are other alternatives of coding that would produce image resizing at a fraction of the time -phase 2 I guess...
The lines you have to edit are as follows:
//Original image
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'src';
$handle->image_convert = 'jpg';
$handle->jpeg_quality = 100;
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = md5("Image".$row->id);
$handle->Process($savepath);
$filename = $handle->file_dst_name_body;
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache';
$src_x = $handle->image_src_x;
//XLarge image
if (JRequest::getInt('itemImageXL')) {
$imageWidth = JRequest::getInt('itemImageXL');
} else {
$imageWidth = $params->get('itemImageXL', '800');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XL';
$handle->Process($savepath);
//Large image
if (JRequest::getInt('itemImageL')) {
$imageWidth = JRequest::getInt('itemImageL');
} else {
$imageWidth = $params->get('itemImageL', '600');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_L';
$handle->Process($savepath);
//Medium image
if (JRequest::getInt('itemImageM')) {
$imageWidth = JRequest::getInt('itemImageM');
} else {
$imageWidth = $params->get('itemImageM', '400');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_M';
$handle->Process($savepath);
//Small image
if (JRequest::getInt('itemImageS')) {
$imageWidth = JRequest::getInt('itemImageS');
} else {
$imageWidth = $params->get('itemImageS', '200');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_S';
$handle->Process($savepath);
//XSmall image
if (JRequest::getInt('itemImageXS')) {
$imageWidth = JRequest::getInt('itemImageXS');
} else {
$imageWidth = $params->get('itemImageXS', '100');
}
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XS';
$handle->Process($savepath);
//Generic image
$imageWidth = $params->get('itemImageGeneric', '300');
if ($src_x > $imageWidth) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = $imageWidth;
} else {
$handle->image_resize = false;
}
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_Generic';
$handle->Process($savepath);
Best regards,
Willie