Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

How to cut image to get proportionally different thumbnail

  • brio54
  • brio54's Avatar Topic Author
  • Offline
  • New Member
More
13 years 11 months ago - 13 years 11 months ago #37961 by brio54
I need some help. I am using galleries with a single thumbnail. Now the issue is that I want this single thumbnail to be cut out of the original image with a different proportion, not just simply resized. Right now the thumbnail is the image, which does not work unless i can request that the first image not be displayed in the gallery folder.

www.brio54-labs.com/index.php/images.html

I found the code in the sigpro_engine.php file.

// cut image if specified by user
   if ($this->cut_x > 0) $orig_x = min($this->cut_x, $orig_x);
   if ($this->cut_y > 0) $orig_y = min($this->cut_y, $orig_y);

Thanks,

Gernot

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

  • brio54
  • brio54's Avatar Topic Author
  • Offline
  • New Member
More
13 years 11 months ago - 13 years 11 months ago #37962 by brio54
or is there any way not to display the thumbnail image in the image gallery ?

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

  • brio54
  • brio54's Avatar Topic Author
  • Offline
  • New Member
More
13 years 11 months ago #37963 by brio54
upgraded to 2.5 and used the viewport without scaling the image. This did the trick, issue resolved.

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

  • brio54
  • brio54's Avatar Topic Author
  • Offline
  • New Member
More
13 years 11 months ago #37964 by brio54
Well, it sort of works, but not really. The result depends on the w/h ratio difference between the source image & the thumbnail:

see example: www.brio54-labs.com/index.php/images.html

(the rendering gallery thumbnail got seriously resized because the ratios are too close.)

Is there no quick way to change the code under [ // calculate the dimensions of the thumbnail ] so the thumbnail is just cropped out of the source image without resizing it? I am not too familiar with php yet, just crossing over from flash.

thanks,

g

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

  • brio54
  • brio54's Avatar Topic Author
  • Offline
  • New Member
More
13 years 11 months ago #37965 by brio54
Here is the fix that worked for me when the image/thumb have similar proportions:

EXAMPLE:
www.brio54-labs.com/index.php/images.html

CODE EDIT:
file: sigpro.engine.php
line:259 (section wide containers, wide thumbs)

original code:
if ($width > $height) { $thumb_width = $thb_width; $thumb_height = ($thb_width*$height/$width);  }

modified code:
if ($width > $height) { $thumb_width = $thb_width*2; $thumb_height = ($thb_width*$height/$width)*2;  }


so long,

g

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

More
13 years 11 months ago #37966 by Katia
Where is the SIG PRO gallery in your site?

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

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

  • brio54
  • brio54's Avatar Topic Author
  • Offline
  • New Member
More
13 years 11 months ago #37967 by brio54

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


Powered by Kunena Forum