Changeset 10641 for trunk/include


Ignore:
Timestamp:
Apr 27, 2011, 7:03:25 PM (13 years ago)
Author:
patdenice
Message:

feature:2284
Create a class to manipulate images.

Location:
trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/config_default.inc.php

    r10570 r10641  
    321321// 'filename'
    322322$conf['uniqueness_mode'] = 'md5sum';
     323
     324// Library used for image resizing. Value could be 'auto', 'imagick',
     325// 'ext_imagick or 'gd'. If value is 'auto', library will be choosen in this
     326// order. If choosen library is not available, another one will be picked up.
     327$conf['image_library'] = 'auto';
     328
     329// If library used is external installation of ImageMagick ('ext_imagick'),
     330// you can define imagemagick directory.
     331$conf['ext_imagick_dir'] = '';
    323332
    324333// +-----------------------------------------------------------------------+
  • trunk/include/ws_functions.inc.php

    r10596 r10641  
    26892689  include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
    26902690  include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
     2691  include_once(PHPWG_ROOT_PATH.'admin/include/image.class.php');
    26912692
    26922693  if (!empty($params['image_id']))
     
    27262727    prepare_directory(dirname($thumb_path));
    27272728
    2728     $result = trigger_event(
    2729       'upload_thumbnail_resize',
    2730       false,
    2731       $image_path,
     2729    $img = new pwg_image($image_path, $params['library']);
     2730
     2731    $result =  $img->pwg_resize(
    27322732      $thumb_path,
    27332733      $params['maxwidth'],
    27342734      $params['maxheight'],
    27352735      $params['quality'],
     2736      $params['automatic_rotation'],
    27362737      true,
    27372738      get_boolean($params['crop']),
    27382739      get_boolean($params['follow_orientation'])
    27392740    );
     2741
     2742    $img->destroy();
    27402743  }
    27412744  elseif (file_exists($hd_path))
    27422745  {
    2743     $result = trigger_event(
    2744       'upload_image_resize',
    2745       false,
    2746       $hd_path,
     2746    $img = new pwg_image($hd_path);
     2747
     2748    $result = $img->pwg_resize(
    27472749      $image_path,
    27482750      $params['maxwidth'],
    27492751      $params['maxheight'],
    27502752      $params['quality'],
     2753      $params['automatic_rotation'],
    27512754      false
    27522755      );
     2756
     2757    $img->destroy();
    27532758
    27542759    if (!empty($image['has_high']))
Note: See TracChangeset for help on using the changeset viewer.