Can I order by name - minifrontpage
- Posted by TemplatePlazza (5261) Offline
I see..it appears blocky and much worse than the article intro image which is roughly the same size.
I'll consider to add settings for image quality for the next release. In the meantime you can open the helper file, arround lines 229 - 241 you will see the quality variables. try to increase 70 to 100
if($file_ext == 'png'){
$imagetype = IMAGETYPE_PNG;
$quality = '7';
$file_ext = 'png';
}elseif($file_ext == 'gif'){
$imagetype = IMAGETYPE_PNG;
$quality = '7';
$file_ext = 'png';
} else {
$imagetype = IMAGETYPE_JPEG;
$quality = '70';
$file_ext = 'jpg';
}
Please Log in or Create an account to join the conversation.
- Posted by ddd rrrr (6) Offline
I have tried the solution you suggested but it only gives a minor increase in quality. It seems the issue is the JImage quality itself (I think) or maybe the fact that the initial image is not that big.
Is there an option to configure the minifrontpage to just use the image as is without generating thumbnails?
Thanks
4 years 10 months ago #8
by ddd rrrr
Is there an option to configure the minifrontpage to just use the image as is without generating thumbnails?
Thanks
Please Log in or Create an account to join the conversation.
- Posted by TemplatePlazza (5261) Offline
I think it because the original file dimension is small and then JImage trying to create a bigger file. Try to change the thumbnail setting with your actual file size and then change the $size_multiplier in the helper file into 1.
at lines 57 comment out or delete this code :change with this :
then find all and replace this code (there are two existing)change with
4 years 10 months ago #9
by TemplatePlazza
You need to bypass the thumbnail creation process for that. Open the tmpl file with your php editor, for example, the template file for default theme : ../modules/mod_minifrontpage/tmpl/default.phpIs there an option to configure the minifrontpage to just use the image as is without generating thumbnails?
at lines 57 comment out or delete this code :
$thumb_img = MinifrontpageHelper::getThumbnail($item->id, $item->images,$thumb_folder,$show_default_thumb,$custom_default_thumb,$thumb_width,$thumb_height,$item->title,$item->introtext,$module->id);
// Thumbnail is not exist
$images = json_decode($item->images);
// Find Article's Image
if (!empty($images->image_intro) ) {
$thumb_img = "<img src='".$images->image_intro."' />";
} elseif (empty($images->image_intro) && !empty($images->image_fulltext) ) {
$thumb_img = "<img src='".$images->image_fulltext."' />";
} else {
// Find first image in the article
$html = $item->introtext;
$html .= "alt='...' title='...' />";
$pattern = '/<img[^>]+src[\\s=\'"]';
$pattern .= '+([^"\'>\\s]+)/is';
if ( preg_match($pattern, $html, $match) ) {
$thumb_img = "<img src='".$match[1]."' />";
} else {
$thumb_img = "";
}
}
then find all and replace this code (there are two existing)
$thumb_img[0];
$thumb_img;
Please Log in or Create an account to join the conversation.
- Posted by ddd rrrr (6) Offline
Thanks for the code, used it and now all is great
Would suggest to allow user to select if to generate thumbnails or not.
4 years 10 months ago #10
by ddd rrrr
Would suggest to allow user to select if to generate thumbnails or not.
Please Log in or Create an account to join the conversation.
- Posted by TemplatePlazza (5261) Offline