Changeset 12696


Ignore:
Timestamp:
12/05/11 19:13:13 (8 years ago)
Author:
patdenice
Message:

Bug corrected with smaller thumbnails than normal size.

Location:
extensions/GThumb
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/GThumb/admin.php

    r12691 r12696  
    1313if (isset($_GET['deletecache'])) 
    1414{ 
    15   check_pwg_token(); 
     15  check_pwg_token();                              
    1616  gtdeltree(GTHUMB_CACHE_DIR); 
    1717  redirect('admin.php?page=plugin-GThumb'); 
     
    7777$template->assign( 
    7878  array( 
    79     'NB_ELEMENTS' => l10n_dec('%d photo', '%d photos', $data['nb_files']), 
     79    'NB_ELEMENTS' => l10n_dec('%d file', '%d files', $data['nb_files']), 
    8080    'ELEMENTS_SIZE' => $data['size'], 
    8181    'PWG_TOKEN' => get_pwg_token(), 
  • extensions/GThumb/js/gthumb.js

    r12691 r12696  
    1313    queue: true,   
    1414    cacheResponse: false, 
    15     maxRequests: 2, 
     15    maxRequests: 3, 
    1616    preventDoubleRequests: false 
    1717  }), 
     
    2424      width = parseInt(jQuery(this).attr('width')); 
    2525      height = parseInt(jQuery(this).attr('height')); 
    26       GThumb.t.push({id:id,width:width,height:height}); 
     26      th = {id:id,width:width,height:height,real_width:width,real_height:height}; 
     27      if (height < GThumb.max_height) { 
     28        th.width = Math.round(GThumb.max_height * width / height); 
     29        th.height = GThumb.max_height; 
     30      } 
     31      GThumb.t.push(th); 
    2732 
    2833      if (jQuery(this).attr('src') == '') { 
     
    164169            new_width = Math.round(new_width); 
    165170          } 
    166           this.resize(jQuery('#gt'+thumb_process[j].id), thumb_process[j].width, thumb_process[j].height, new_width, new_height, false); 
     171          this.resize(jQuery('#gt'+thumb_process[j].id), thumb_process[j].real_width, thumb_process[j].real_height, new_width, new_height, false); 
    167172 
    168173          width_count += new_width + this.margin; 
     
    177182    // Last line does not need to be cropped 
    178183    for (j=0;j<thumb_process.length;j++) { 
    179       this.resize(jQuery('#gt'+thumb_process[j].id), thumb_process[j].width, thumb_process[j].height, thumb_process[j].width, max_height, false); 
     184      this.resize(jQuery('#gt'+thumb_process[j].id), thumb_process[j].real_width, thumb_process[j].real_height, thumb_process[j].width, max_height, false); 
    180185    } 
    181186 
     
    187192  resize: function(thumb, width, height, new_width, new_height, is_big) { 
    188193 
    189     if (this.method == 'resize') { 
    190       real_width = Math.min(new_width, width); 
    191       real_height = Math.min(new_height, height); 
     194    if (this.method == 'resize' || height < new_height || width < new_width) { 
     195      real_width = new_width; 
     196      real_height = new_height; 
    192197      width_crop = 0; 
    193198      height_crop = 0; 
  • extensions/GThumb/language/en_UK/plugin.lang.php

    r12691 r12696  
    88$lang['Cache Informations'] = 'Cache Informations'; 
    99$lang['Clear the cache'] = 'Clear the cache'; 
     10$lang['%d file'] = '%d file'; 
     11$lang['%d files'] = '%d files'; 
    1012 
    1113?> 
  • extensions/GThumb/language/fr_FR/plugin.lang.php

    r12691 r12696  
    88$lang['Cache Informations'] = 'Informations du cache'; 
    99$lang['Clear the cache'] = 'Effacer le cache'; 
     10$lang['%d file'] = '%d fichier'; 
     11$lang['%d files'] = '%d fichiers'; 
    1012 
    1113?> 
  • extensions/GThumb/template/gthumb.tpl

    r12691 r12696  
    1818GThumb.margin = {$GThumb.margin}; 
    1919GThumb.method = '{$GThumb.method}'; 
     20 
     21{if isset($big_thumb)} 
    2022GThumb.small_thumb = {ldelim}id:{$small_thumb.id},src:'{$small_thumb.src}',width:{$small_thumb.width},height:{$small_thumb.height}{rdelim}; 
    21 {if isset($big_thumb)} 
    2223GThumb.big_thumb = {ldelim}id:{$big_thumb.id},src:'{$big_thumb.src}',width:{$big_thumb.width},height:{$big_thumb.height}{rdelim}; 
    2324{/if} 
Note: See TracChangeset for help on using the changeset viewer.