Keyword

Original image size in item view

More
12 years 2 months ago #100855 by Vlad
Original image size in item view was created by Vlad
Dear experienced users,

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.

More
12 years 2 months ago #100856 by Lefteris
Replied by Lefteris on topic Re: Original image size in item view
K2 will resize the images to the dimensions you have setup. So you can try to set the dimensions according to your needs. You can also select to display the Small or Extra Small size in categories that you expect to have small images.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #100857 by Vlad
Replied by Vlad on topic Re: Original image size in item view
And is there any way to make k2 NOT to scale images more than original size?
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
  • etkritikonspoudon's Avatar
  • Offline
  • Junior Member
More
12 years 2 months ago - 12 years 2 months ago #100858 by etkritikonspoudon
Replied by etkritikonspoudon on topic Re: Original image size in item view
Yes, this would be a very welcome feature...

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.

More
11 years 11 months ago #100859 by Francesco
Replied by Francesco on topic Re: Original image size in item view
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);

Please Log in or Create an account to join the conversation.

  • etkritikonspoudon
  • etkritikonspoudon's Avatar
  • Offline
  • Junior Member
More
11 years 9 months ago #100860 by etkritikonspoudon
Replied by etkritikonspoudon on topic Re: Original image size in item view

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.


Powered by Kunena Forum