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

version 1.0.22 - see changelog for details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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()) {
Note: See TracChangeset for help on using the changeset viewer.