Ignore:
Timestamp:
03/26/11 13:42:34 (9 years ago)
Author:
patdenice
Message:

Do not use temp file

Location:
extensions/external_ImageMagick/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/external_ImageMagick/trunk/imagick.class.php

    r9859 r9860  
    44{ 
    55  var $source_path = ''; 
    6   var $tmp_path = ''; 
    76  var $image_data = array(); 
    87  var $imagemagickdir = ''; 
     
    4948 
    5049    if (isset($conf['imagick_dir'])) 
    51       $this->imagemagickdir = rtrim($conf['imagick_dir'], ' /\\').(PHP_OS == 'WINNT' ? '\\' : '/'); 
    52  
    53     $this->tmp_path = @tempnam($conf['local_data_dir'], get_extension($this->source_path)); 
     50      $this->imagemagickdir = rtrim($conf['imagick_dir'], ' /\\').'/'; 
    5451 
    5552    $command = $this->imagemagickdir."identify -verbose ".realpath($this->source_path); 
     
    142139    } 
    143140 
    144     $exec .= ' '.realpath($this->tmp_path); 
     141    $dest = pathinfo($destination_filepath); 
     142    $exec .= ' '.realpath($dest['dirname']).'/'.$dest['basename']; 
    145143    @exec($exec, $returnarray, $returnvalue); 
    146     @rename($this->tmp_path, $destination_filepath); 
    147     @chmod($destination_filepath, 0644); 
    148144  } 
    149145 
  • extensions/external_ImageMagick/trunk/main.inc.php

    r9856 r9860  
    4242  global $conf; 
    4343 
    44   $imagick_dir = isset($conf['imagick_dir']) ? rtrim($conf['imagick_dir'], ' /\\').(PHP_OS == 'WINNT' ? '\\' : '/') : ''; 
     44  $imagick_dir = isset($conf['imagick_dir']) ? rtrim($conf['imagick_dir'], ' /\\').'/' : ''; 
    4545  @exec($imagick_dir.'convert', $returnarray, $returnvalue); 
    4646  return (!$returnvalue and !empty($returnarray[0]) and preg_match('/ImageMagick/', $returnarray[0])); 
Note: See TracChangeset for help on using the changeset viewer.