1. p.luks
  2. Sherlock Holmes
  3. Commercial Templates
  4. Sunday, 01 January 2017
  5.  Subscribe via email
Hello,

the original thumbsgallery can not crop the thumbnails. I have a upgrade for this. You must change the file "resize.image.class.php"
I have add a function before the "ImageCopyResampled" :)

$w_new = $this -> new_width;
$h_new = $this -> new_height;
$x=$this -> new_width;

$ratio = $width/$height;
if ($w_new/$h_new > $ratio) {
//portrait
$this -> new_height = $h_new/$ratio;
$x=0;
} else {
//landscape
$this -> new_width = $h_new*$ratio;
$x=$this -> new_width - $x;
}
ImageCopyResampled( $image_c, $new_image, 0, 0, $x, 0, $this -> new_width, $this -> new_height, $width, $height );


The ´portraits cropped bottom and the landscape images cropped right and left.
When you dont crop right and left the landscape images, then leave the original row:

ImageCopyResampled( $image_c, $new_image, 0, 0, 0, 0, $this -> new_width, $this -> new_height, $width, $height );
Accepted Answer Pending Moderation
0
Votes
Undo
Excellent work.. thank you for sharing this with us! :)

We will certainly be looking in to adding this as an option within the modules parameters.

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
with pleasure :)
I have seen the module in my zip file is not correct. Here I have a working module.

We get lots of nice things from you. Therefore I like to help with.
Attachments (1)
  1. more than a month ago
  2. Commercial Templates
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
Hello p.luks,
Hello Ciaran,

Looks great. Thanks for the good job.
How do I manage this further ? I have a site with 10 instances of thumbsgallery and of course I prefer to keep all module-configurations.
So, can I simply install “mod_j51thumbsgallery_new.zip” and will all existing configurations be kept ?
Or do I better paste the above code in resize.image.class.php ?
Or will soon an updated “mod_j51thumbsgallery .zip” be available ?

Thanks for your advice.
  1. more than a month ago
  2. Commercial Templates
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
Hello,

the "mod_j51thumbsgallery_new.zip" is a new module. This does not overwrite the original module.


  • you can write the code in your resize.image.class.php or
  • you extract the zip file and overwrite the Image.class.php


When you install the "mod_j51thumbsgallery_new.zip" then you have two modules - original and the new.

Peer
  1. more than a month ago
  2. Commercial Templates
  3. # 4
Accepted Answer Pending Moderation
0
Votes
Undo
Dear Peer,

Thanks for your info. I start testing.

Is it also OK to rename the resize.image.class.php ( f.i. resize.image.class.old.php ) and putting the new extracted file aside ?

Thanks for your advice.
  1. more than a month ago
  2. Commercial Templates
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!