Changeset 12175


Ignore:
Timestamp:
09/17/11 23:03:58 (8 years ago)
Author:
plg
Message:

feature 2441 added: no need to have the HD to regenerate the websize if the
current websize is bigger than resize settings. When it occurs, we move the
current websize as HD and create the new websize from it.

Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/batch_manager_global.tpl

    r11853 r12175  
    739739      <p> 
    740740        <img src="admin/themes/default/icon/warning.png" alt="!" style="vertical-align:middle;"> 
    741         {'Only photos with HD can be regenerated!'|@translate} 
     741        {'By default, Piwigo will create a new websize from the HD (high definition) version of your photo.'|@translate} 
     742        {'If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.'|@translate} 
    742743      </p> 
    743744 
  • trunk/include/ws_functions.inc.php

    r11962 r12175  
    29632963 
    29642964  $query=' 
    2965 SELECT id, path, tn_ext, has_high 
     2965SELECT id, path, tn_ext, has_high, width, height 
    29662966  FROM '.IMAGES_TABLE.' 
    29672967  WHERE id = '.(int)$params['image_id'].' 
     
    29752975 
    29762976  $image_path = $image['path']; 
     2977 
     2978  if (!is_valid_image_extension(get_extension($image_path))) 
     2979  { 
     2980    return new PwgError(403, "image can't be resized"); 
     2981  } 
     2982   
    29772983  $hd_path = get_high_path($image); 
    29782984 
    2979   if (empty($image['has_high']) or !file_exists($hd_path) or !is_valid_image_extension(get_extension($image_path))) 
    2980   { 
    2981     return new PwgError(403, "image can't be resized"); 
     2985  if (empty($image['has_high']) or !file_exists($hd_path)) 
     2986  { 
     2987    if ($image['width'] > $params['maxwidth'] or $image['height'] > $params['maxheight']) 
     2988    { 
     2989      $hd_path = file_path_for_type($image_path, 'high'); 
     2990      $hd_dir = dirname($hd_path); 
     2991      prepare_directory($hd_dir); 
     2992       
     2993      rename($image_path, $hd_path); 
     2994      $hd_infos = pwg_image_infos($hd_path); 
     2995 
     2996      single_update( 
     2997        IMAGES_TABLE, 
     2998        array( 
     2999          'has_high' => 'true', 
     3000          'high_filesize' => $hd_infos['filesize'], 
     3001          'high_width' => $hd_infos['width'], 
     3002          'high_height' => $hd_infos['height'], 
     3003          ), 
     3004        array( 
     3005          'id' => $image['id'] 
     3006          ) 
     3007        ); 
     3008    } 
     3009    else 
     3010    { 
     3011      return new PwgError(403, "image can't be resized"); 
     3012    } 
    29823013  } 
    29833014 
  • trunk/language/cs_CZ/admin.lang.php

    r12105 r12175  
    803803$lang['%s photos have been regenerated'] = '%s fotek bylo regenerováno'; 
    804804$lang['%s photos can not be regenerated'] = '%s fotek nemohlo být regenerováno'; 
    805 $lang['Only photos with HD can be regenerated!'] = 'Pouze fotky s vysokým rozlišením mohou být regenerovány!'; 
    806805$lang['Updates'] = 'Aktualizace'; 
    807806$lang['Update in progress... Please wait.'] = 'Probíhá aktualizace... Prosím čekejte.'; 
  • trunk/language/de_DE/admin.lang.php

    r12105 r12175  
    791791$lang['%s photos have been regenerated'] = '%s Fotos wurden neu erstellt'; 
    792792$lang['%s photos can not be regenerated'] = '%s Fotos konnten nicht neu erstellt werden'; 
    793 $lang['Only photos with HD can be regenerated!'] = 'Diese Erweiterung berücksichtigt nur HD Material!'; 
    794793$lang['new'] = 'neu'; 
    795794$lang['No results'] = 'Keine Ergebnisse'; 
  • trunk/language/en_UK/admin.lang.php

    r12106 r12175  
    802802$lang['%s photos have been regenerated'] = '%s photos have been regenerated'; 
    803803$lang['%s photos can not be regenerated'] = '%s photos can not be regenerated'; 
    804 $lang['Only photos with HD can be regenerated!'] = 'Only photos with HD can be regenerated!'; 
    805804 
    806805$lang['Updates'] = 'Updates'; 
     
    860859$lang['Learn more'] = 'Learn more'; 
    861860$lang['Select an album'] = 'Select an album'; 
     861$lang['By default, Piwigo will create a new websize from the HD (high definition) version of your photo.'] = 'By default, Piwigo will create a new websize from the HD (high definition) version of your photo.'; 
     862$lang['If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.'] = 'If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.'; 
    862863?> 
  • trunk/language/es_ES/admin.lang.php

    r12170 r12175  
    787787$lang['%s photos have been regenerated'] = '%s fotos fueron regeneradas.'; 
    788788$lang['%s photos can not be regenerated'] = '%s fotos no pueden ser regeneradas'; 
    789 $lang['Only photos with HD can be regenerated!'] = 'Sólo las fotos de alta definición pueden ser regeneradas'; 
    790789$lang['display'] = 'Visualizar'; 
    791790$lang['Type in a search term'] = 'Introduce un término de búsqueda'; 
  • trunk/language/fr_FR/admin.lang.php

    r12106 r12175  
    801801$lang['%s photos have been regenerated'] = '%s photos ont été régénérées'; 
    802802$lang['%s photos can not be regenerated'] = '%s photos ne peuvent pas être régénérées'; 
    803 $lang['Only photos with HD can be regenerated!'] = 'Seules les photos avec HD peuvent être régénérées'; 
    804803 
    805804$lang['Updates'] = 'Mises à jour'; 
     
    871870$lang['Learn more'] = 'En savoir plus'; 
    872871$lang['Select an album'] = 'Selectionnez un album'; 
     872$lang['By default, Piwigo will create a new websize from the HD (high definition) version of your photo.'] = 'Par défaut, Piwigo créera la nouvelle taille web à partir de la HD (haute définition).'; 
     873$lang['If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.'] = 'Si la HD n\'est pas disponible et que la version actuelle de la taille web est plus grande que les dimensions ci-dessous, alors Piwigo la considérera comme HD et créera la nouvelle taille web à partir de celle-ci.'; 
    873874?> 
  • trunk/language/he_IL/admin.lang.php

    r12105 r12175  
    813813$lang['%s photos have been regenerated'] = '%s תמונות חודשו'; 
    814814$lang['%s photos can not be regenerated'] = '%s תמונות לא יכלו להתחדש'; 
    815 $lang['Only photos with HD can be regenerated!'] = 'רק תמונות HD יכולות להתחדש!'; 
    816815$lang['Updates'] = 'עדכונים'; 
    817816$lang['Update in progress... Please wait.'] = 'עדכון בתהליך... המתן.'; 
  • trunk/language/hu_HU/admin.lang.php

    r12168 r12175  
    799799$lang['%s photos have been regenerated'] = '%s kép újragenerálva'; 
    800800$lang['%s photos can not be regenerated'] = '%s képet nem lehet újragenerálni'; 
    801 $lang['Only photos with HD can be regenerated!'] = 'Csak HD képeket lehet újragenerálni!'; 
    802801$lang['Updates'] = 'Frissítések'; 
    803802$lang['Update in progress... Please wait.'] = 'Frissítés folyamatban... Kérem várjon.'; 
  • trunk/language/it_IT/admin.lang.php

    r12140 r12175  
    801801$lang['%s photos have been regenerated'] = '%s foto sono state rigenerate'; 
    802802$lang['%s photos can not be regenerated'] = '%s foto non possono essere rigenerate'; 
    803 $lang['Only photos with HD can be regenerated!'] = 'Solo le foto con una HD possono essere rigenerate'; 
    804803 
    805804$lang['Updates'] = 'Aggiornamento'; 
  • trunk/language/lv_LV/admin.lang.php

    r12138 r12175  
    782782$lang['%s photos have been regenerated'] = 'izveidotas %s fotogrāfijas'; 
    783783$lang['%s photos can not be regenerated'] = '%s fotogrāfijas nav iespējams reģenerēt'; 
    784 $lang['Only photos with HD can be regenerated!'] = 'Tikai HD kvalitātes fotogrāfijas iespējams reģenerēt!'; 
    785784$lang['new'] = 'jauns'; 
    786785$lang['No results'] = 'Nav rezultātu'; 
  • trunk/language/nl_NL/admin.lang.php

    r12105 r12175  
    790790$lang['%s photos have been regenerated'] = '%s foto\'s zijn hergegenereerd.'; 
    791791$lang['%s photos can not be regenerated'] = '%s foto\'s konden niet opnieuw gegenereerd worden.'; 
    792 $lang['Only photos with HD can be regenerated!'] = 'Alleen foto\'s met HD kunnen opnieuw worden gegenereerd!'; 
    793792$lang['display'] = 'toon'; 
    794793$lang['new'] = 'nieuw'; 
  • trunk/language/pl_PL/admin.lang.php

    r12148 r12175  
    800800$lang['%s photos have been regenerated'] = 'Stworzono %s zdjęć'; 
    801801$lang['%s photos can not be regenerated'] = '%s zdjęć nie mogło zostać stworzonych'; 
    802 $lang['Only photos with HD can be regenerated!'] = 'Tylko zdjęcia HD mogą być ponownie utworzone!'; 
    803802$lang['Updates'] = 'Aktualizacje'; 
    804803$lang['Update in progress... Please wait.'] = 'Trwa aktualizacja... Proszę czekać.'; 
  • trunk/language/ru_RU/admin.lang.php

    r12130 r12175  
    799799$lang['%s photos have been regenerated'] = '%s фотографий было создано заново'; 
    800800$lang['%s photos can not be regenerated'] = '%s фотографий не было создано заново'; 
    801 $lang['Only photos with HD can be regenerated!'] = 'Только фотографии с HD могут быть созданы заново!'; 
    802801$lang['Updates'] = 'Обновление'; 
    803802$lang['Update in progress... Please wait.'] = 'Процесс обновления... Пожалуйста, подождите.'; 
  • trunk/language/sk_SK/admin.lang.php

    r12105 r12175  
    792792$lang['%s photos have been regenerated'] = '%s fotografií bolo vytvorených'; 
    793793$lang['%s photos can not be regenerated'] = '%s fotografií nebolo vytvorených'; 
    794 $lang['Only photos with HD can be regenerated!'] = 'Len forografie v HD môžu byť vytvorené!'; 
    795794$lang['new'] = 'nové'; 
    796795$lang['No results'] = 'Bez výsledkov'; 
  • trunk/language/sr_RS/admin.lang.php

    r12105 r12175  
    802802$lang['%s photos have been regenerated'] = 'Број регенерисаних фотографија: %s'; 
    803803$lang['%s photos can not be regenerated'] = 'Број фотографија који се не може регенерисати: %s'; 
    804 $lang['Only photos with HD can be regenerated!'] = 'Само фотографије у HD могу бити регенерисане!'; 
    805804$lang['Updates'] = 'Унапређење'; 
    806805$lang['Update in progress... Please wait.'] = 'У току је унапређење... Молимо Вас да сачеката.'; 
  • trunk/language/sv_SE/admin.lang.php

    r12158 r12175  
    788788$lang['%s photos have been regenerated'] = '%s foton har skapats'; 
    789789$lang['%s photos can not be regenerated'] = '%s foton har inte skapats'; 
    790 $lang['Only photos with HD can be regenerated!'] = 'Endast foton med HD kan regenereras!'; 
    791790$lang['new'] = 'ny'; 
    792791$lang['No results'] = 'Inga poster hittades'; 
  • trunk/language/tr_TR/admin.lang.php

    r12105 r12175  
    784784$lang['%s photos have been regenerated'] = '%s resimler oluşturuldu'; 
    785785$lang['%s photos can not be regenerated'] = '%s resimler oluşturulamadı'; 
    786 $lang['Only photos with HD can be regenerated!'] = 'Sadece HD  olan resimler oluşturulabilir!'; 
    787786$lang['new'] = 'yeni'; 
    788787$lang['No results'] = 'Sonuç yok'; 
  • trunk/language/vi_VN/admin.lang.php

    r12105 r12175  
    788788$lang['%s photos have been regenerated'] = 'có %s ảnh đã được tạo ra'; 
    789789$lang['%s photos can not be regenerated'] = 'Có %s ảnh không thể tạo ra được'; 
    790 $lang['Only photos with HD can be regenerated!'] = 'Chỉ có những ảnh định dạng cao mới có thể được khởi tạo!'; 
    791790$lang['new'] = 'mới'; 
    792791$lang['No results'] = 'Không có kết quả nào'; 
  • trunk/language/zh_CN/admin.lang.php

    r12105 r12175  
    801801$lang['%s photos have been regenerated'] = '%s 相片已被生成'; 
    802802$lang['%s photos can not be regenerated'] = '%s 相片不能被生成'; 
    803 $lang['Only photos with HD can be regenerated!'] = '只有高清相片才可被生成!'; 
    804803$lang['Update in progress... Please wait.'] = '正在更新... 请稍等.'; 
    805804$lang['Ignore this update'] = '忽略此更新'; 
Note: See TracChangeset for help on using the changeset viewer.