Keyword

Resize thumbnail images automatically?

  • Ante Oja
  • Ante Oja's Avatar Topic Author
  • Offline
  • New Member
More
13 years 5 months ago #95556 by Ante Oja
Resize thumbnail images automatically? was created by Ante Oja
Hello K2 members!

The thumbnail image on my items on my website is set to 157x157

So for example, If I add a image thats 1000x1000 to an item, it resizes to 157x157.

But if I ad a image thats 100x200 it only resizes to 100x157.

 

I want all my thumbnails image to be 157x157

I'll show with 2 pictures



 

 

 

 

 

 

It looks like this at the moment. Under the item "KaitarN - Det bästa" you can se that the image doesnt resizes to 157x157 as the other images are.

 

 

 

 

 

 



 

 

 

 

 

 

I want it to look something like this. So the thumbnail image resizes automatically to 157x157

 

 

 

 

 

 

 

 

 

 

 

Thanks in advance!

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 5 months ago #95557 by Yiota
Replied by Yiota on topic Resize thumbnail images automatically?
You can achieve this by html resize.

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

  • Ante Oja
  • Ante Oja's Avatar Topic Author
  • Offline
  • New Member
More
13 years 5 months ago #95558 by Ante Oja
Replied by Ante Oja on topic Resize thumbnail images automatically?
I did found: <img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />

If the image is WIDER than it is high I want the image to get as a square for example 157x157. How do I then change the code?

Thanks in advance!

Yiota Ziaggou said:
You can achieve this by html resize.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 5 months ago #95559 by Yiota
Replied by Yiota on topic Resize thumbnail images automatically?
But the image is already resized in 157 width. If it was wider, width>height, then even resized the height would be smaller than the width. All images are resized proportionally according to the width dimension.

A thing I occasionaly do when I want all my images to be in a specific dimensions block, I set a slightly bigger image dimension, i.e. if my box is 157, I set the image to 200. Then I actually load the image as a background positioned in the center and I hide width overflow:hidden the parts out of the 157 block.

Another thing you can try, I haven't though, is to install this plugin that gives a more manipulative aspect on the images of K2.

 

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


Powered by Kunena Forum