Keyword

How to cancel image re-sizing?

More
8 years 1 month ago - 8 years 1 month ago #157610 by Maria
How to cancel image re-sizing? was created by Maria
Hello!

I have a WARP6 template with K2 installed. I'm having a problem with not being able to open a full sized image if I use widgekit lightbox or SigPlus gallery (same result). Once I click on thumbnail, I get a re-sized (SMALLER about 50%) version of a full image. So the only way to see a full image is to go to "View image" option. But it's not the way it should be, let alone that my site visitors probably won't even know about this option.
So my question is how to cancel re-sizing, so my images would be shown in FULL size?
Last edit: 8 years 1 month ago by Maria.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 1 month ago #157622 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to cancel image re-sizing?
Hello,

You can change which image size is being used in K2's category settings.

Just make sure that the category is not inheriting its settings from another category.

Unfortunately for settings regarding SigPlus and widgetkit you need to ask the extensions' developers.

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

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

More
8 years 1 month ago #157646 by Maria
Replied by Maria on topic How to cancel image re-sizing?
Thanks for your reply!

Okay, here's live URL, so it would be easier to show it. It's just a test site.

idevsky.com

In the beginning, I thought it's an issue with lightbox, but when I saw that it's the same with Sigplus, then I think it's probably a K2 issue. That's why I even mentioned those two to begin with. Just to show that if an issue repeats itself under different circumstances, then it's probably something else.

Please, explain it step by step, otherwise I won't understand. I go to K2 - Categories - Parameters - Images, correct? There I can see different widths for different image sizes. Then what? What does it all mean, in the context of my issue? What should be done?

"category is not inheriting its settings from another category" - Likewise, what exactly and where I should check?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 1 month ago #157654 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to cancel image re-sizing?
Sigplus is not affiliated with us.
Our product is Simple Image Gallery Pro.

In the category's settings under the Display Settings and especially the "Item view options" section you will find the option of which image size to use.

As for "category is not inheriting its settings from another category" check the Inherit parameter options from category setting.

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

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

More
8 years 1 month ago #157701 by Maria
Replied by Maria on topic How to cancel image re-sizing?
First of all, thanks for your reply!

If I understand it correctly, then I have to check first in K2 Parameters under Images which sizes of specific type of images are set. For example, let's say, it's set that for L (Large) images I see there 600px. After that I go to my K2 category (I only have one K2 category) and there I go to "Display settings" and in "Item view options" section where "Image size" is I check what type of image it's set there. Let's say that it's set to Large. So now is my question under this specific situation (as an example so it would be easier for me to understand it). Let's say I have an article (K2 item) and I have a JPEG image that I want to insert into this item (article). If the image is 600px wide or smaller, then it won't get re-sized automatically by K2. If the image is larger (wider) than 600px, then after I insert that image into an article (K2 item) it WILL be automatically scaled down to 600px. Am I right?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 1 month ago #157719 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to cancel image re-sizing?

Let's say I have an article (K2 item) and I have a JPEG image that I want to insert into this item (article). If the image is 600px wide or smaller, then it won't get re-sized automatically by K2.


Yes if you use K2's image tab, then the image will be automatically resized to all sizes. It doesn't matter if it is smaller or larger, all sizes will be generated.

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

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

More
8 years 1 month ago #157743 by Maria
Replied by Maria on topic How to cancel image re-sizing?
Again, we talk in circles here. I'm not asking about what is being generated. I'm only asking how TO PREVENT from an automatic image re-sizing.
In other words, let's say I have an article and I want to put an image in it, OK? The image size is TOO BIG to fit in. Then what happens is that in my case this image gets automatically scaled down (become smaller in size) without interaction on my part (without me doing anything). That's all there's to it.
So again, my question is what exactly I should do to cancel this kinda of re-sizing.
Thank you!

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 1 month ago #157757 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to cancel image re-sizing?
You will need to swap the image with an extrafield then.
However you will need to alter the template you are using or override the default one getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

The base code can be found here:
github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L77-L93

Please note that if the template is using CSS overrides (min/max-width) this won't change anything.

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

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

More
8 years 1 month ago #157809 by Maria
Replied by Maria on topic How to cancel image re-sizing?
Thanks for your reply!
Okay, I'll look into it. The relevant piece of code from GitHub is this, right?
// Use an extrafield instead of K2's images - The extrafield is an IMAGE one
<?php if( $this->item->params->get('itemImage') && $this->item->extraFields->EXTRAFIELDALIASHERE->value !== '' ):
	$var = $this->item->extraFields->EXTRAFIELDALIASHERE->value ;     
	$var = preg_replace('/<img src="/',"",$var); 
	$var = preg_replace('/"> alt="Image" \>/'," ",$var); ?>

	<img src="<?php echo $var; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />

<?php endif; ?>

If yes, then please let me know where this PHP code should go to, which file?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 1 month ago #157816 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to cancel image re-sizing?
This is for the item.php file.
You will have to adapt it for the category_item.php file as well and the tag.php, user.php and generic.php (if you are using tags, user pages and K2's search listings.)

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

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


Powered by Kunena Forum