Ignore:
Timestamp:
Dec 22, 2010, 4:15:35 PM (13 years ago)
Author:
plg
Message:

feature 2077 added: when ImageMagick is active, ability to remove or resize
the high definition version of the photo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_upload.inc.php

    r8219 r8227  
    8585      false
    8686      );
     87
     88    if (is_imagick())
     89    {
     90      if ($conf['upload_form_hd_keep'])
     91      {
     92        $need_resize = need_resize($high_path, $conf['upload_form_hd_maxwidth'], $conf['upload_form_hd_maxheight']);
     93       
     94        if ($conf['upload_form_hd_resize'] and $need_resize)
     95        {
     96          pwg_image_resize(
     97            false,
     98            $high_path,
     99            $high_path,
     100            $conf['upload_form_hd_maxwidth'],
     101            $conf['upload_form_hd_maxheight'],
     102            $conf['upload_form_hd_quality'],
     103            false
     104            );
     105          $high_infos = pwg_image_infos($high_path);
     106        }
     107      }
     108      else
     109      {
     110        unlink($high_path);
     111        $high_infos = null;
     112      }
     113    }
    87114  }
    88115
     
    251278  }
    252279
    253   if (extension_loaded('imagick'))
     280  if (is_imagick())
    254281  {
    255282    return pwg_image_resize_im($source_filepath, $destination_filepath, $max_width, $max_height, $quality, $strip_metadata);
     
    521548  array_push($_SESSION['uploads_error'][$upload_id], $error_message);
    522549}
     550
     551function is_imagick()
     552{
     553  if (extension_loaded('imagick'))
     554  {
     555    return true;
     556  }
     557
     558  return false;
     559}
    523560?>
Note: See TracChangeset for help on using the changeset viewer.