- Posts: 2
COMMUNITY FORUM
Original image size in item view
- Vlad
-
Topic Author
- Offline
- New Member
I've faced with the problem when assigning small size images for items. They are showed really big and pixelated in category or item view layout.
I've browsed throgh k2 settings and was able to find how to set up only absolute sizes for images.
Is there any way to prohibit k2 from oversizing images bigger than original 100% size???
Thank you.
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Please Log in or Create an account to join the conversation.
- Vlad
-
Topic Author
- Offline
- New Member
- Posts: 2
It should be a really nice feature, if will be included in k2.
Will save a lot of time, which may be needed for image preparations.
Please Log in or Create an account to join the conversation.
- etkritikonspoudon
-
- Offline
- Junior Member
- Posts: 38
One can set smaller sizes for display, but the popup can still overstretch the image...one can set XL image size to reflect a "safe" size, but this is far from optimal and functional...
This feature request has been repeated a few times, e.g.
code.google.com/p/getk2/issues/detail?id=221
getk2.org/community/New-to-K2-Ask-here-first/2087-Request-Add-Options-for-Image-Handling--Item-View
For me this is one of the things that has kept me with Joomla, despite strong attempts to adopt K2 (has some very useful/welcome features)
- Image-size variables in K2 (at least prevent oversizing)
- Inabiblity to use punctuation marks in tags
- Pagebreak doesn't work
- An easy way to clean created item images
Please Log in or Create an account to join the conversation.
- Francesco
-
- Offline
- New Member
- Posts: 4
For example :
//Large image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$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';
if (JRequest::getInt('itemImageL')) {
$imageWidth = JRequest::getInt('itemImageL');
} else {
$imageWidth = $params->get('itemImageL', '600');
}
/* Hack !
if (($handle->image_src_x) < $imageWidth) {
$imageWidth = $handle->image_src_x;
}
/ Hack end !
$handle->image_x = $imageWidth;
$handle->Process($savepath);
Please Log in or Create an account to join the conversation.
- etkritikonspoudon
-
- Offline
- Junior Member
- Posts: 38
Francesco wrote: Hi, you could make a little hack to item.php (administrator\components\com_k2\models\item.php) using the following changes:
For example :
//Large image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$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';
if (JRequest::getInt('itemImageL')) {
$imageWidth = JRequest::getInt('itemImageL');
} else {
$imageWidth = $params->get('itemImageL', '600');
}
/* Hack !
if (($handle->image_src_x) < $imageWidth) {
$imageWidth = $handle->image_src_x;
}
/ Hack end !
$handle->image_x = $imageWidth;
$handle->Process($savepath);
Was this a response towards my question?
I tried your code, but it didn't bring about any change in the behaviour of the K2 Item Images
Please Log in or Create an account to join the conversation.