Changeset 32032


Ignore:
Timestamp:
Nov 25, 2019, 1:52:19 AM (4 years ago)
Author:
SergeD
Message:

version 1.0.22 - see changelog for details

Location:
extensions/GDThumb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/GDThumb/changelog.txt

    r32029 r32032  
    2626
    2727=== Changelog ===
     28version 1.0.22
     29- Fix for tile crop - see https://piwigo.org/forum/viewtopic.php?pid=168141#p168141
     30
    2831version 1.0.21
    2932+ Support for PIWIGO 2.9 and 2.10 verified
  • extensions/GDThumb/js/gdthumb.js

    r32029 r32032  
    255255    }
    256256
    257     // Last line does not need to be cropped
     257    // Crop last line only if we have more than one line
    258258    for (j = 0; j < thumb_process.length; j++) {
    259                         GDThumb.resize(jQuery('ul.thumbnails img.thumbnail').eq(thumb_process[j].index), thumb_process[j].real_width, thumb_process[j].real_height, thumb_process[j].width, last_height, false);
    260                 }
     259
     260      // we have only one line, i.e. the first line is the one and only line and therefor the last line too
     261      if (line == 1) {
     262        GDThumb.resize(jQuery('ul.thumbnails img.thumbnail').eq(thumb_process[j].index), thumb_process[j].real_width, thumb_process[j].real_height, thumb_process[j].width, last_height, false);
     263      }
     264      // we have more than one line
     265      else {
     266        if ((GDThumb.method == 'square') || (GDThumb.method == 'slide')) {
     267          new_width = GDThumb.max_height;
     268          new_height = GDThumb.max_height;
     269        }
     270        else {
     271          new_width = (thumb_process[j].width + round_rest) / ratio;
     272          round_rest = new_width - Math.round(new_width);
     273          new_width = Math.round(new_width);
     274        }
     275
     276        GDThumb.resize(jQuery('ul.thumbnails img.thumbnail').eq(thumb_process[j].index), thumb_process[j].real_width, thumb_process[j].real_height, new_width, new_height, false);
     277        last_height = Math.min(last_height, new_height);
     278
     279        width_count += new_width + GDThumb.margin;
     280      }
     281    }
    261282
    262283    if (main_width != jQuery('ul.thumbnails').width()) {
  • extensions/GDThumb/main.inc.php

    r32029 r32032  
    22/*
    33Plugin Name: gdThumb
    4 Version: 1.0.21
     4Version: 1.0.22
    55Description: Apply Masonry style to album or image thumbs
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=771
     
    1919// | Plugin constants                                               |
    2020// +-----------------------------------------------------------------------+
    21 define('GDTHUMB_VERSION', '1.0.21');
     21define('GDTHUMB_VERSION', '1.0.22');
    2222define('GDTHUMB_ID',      basename(dirname(__FILE__)));
    2323define('GDTHUMB_PATH' ,   PHPWG_PLUGINS_PATH . GDTHUMB_ID . '/');
Note: See TracChangeset for help on using the changeset viewer.