Changeset 378


Ignore:
Timestamp:
Dec 21, 2010 9:44:41 PM (13 years ago)
Author:
anonymous
Message:

Source file bug in ImageThumb?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/lib/ImageThumb.inc.php

    r1 r378  
    185185    function processFile($file_name)
    186186    {
     187        // Source file determined by provided file_name.
     188        $source_file = realpath($this->source_dir . '/' . $file_name);
     189
    187190        // Ensure we have valid binaries.
    188191        if (!$this->_valid_binaries) {
     
    252255           
    253256            // Determine if original file size is smaller than specified thumbnail size. Do not scale-up if allow_upscaling config is set to false.
    254             $image_size = getimagesize(realpath($this->source_dir . '/' . $file_name));
     257            $image_size = getimagesize($source_file);
    255258            if ($image_size['0'] <= $s['width'] && $image_size['1'] <= $s['height'] && !$s['allow_upscaling']) {
    256259                $pnmscale_args = ' 1 ';
    257                 logMsg(sprintf('Image %s smaller than specified %s thumbnail size. Keeping original size.', $file_name, $s['dest_dir']), LOG_DEBUG, __FILE__, __LINE__);
     260                logMsg(sprintf('Image %s smaller (%sx%s) than specified %s thumbnail size (%sx%s). Keeping original size.', $source_file, $image_size['0'], $image_size['1'], $s['dest_dir'], $s['width'], $s['height']), LOG_DEBUG, __FILE__, __LINE__);
    258261            } else {
    259262                $pnmscale_args = $s['pnmscale_args'];
     
    261264           
    262265            // Execute the command that creates the thumbnail.
    263             $command = sprintf('%s %s/%s | %s %s | %s %s > %s/%s',
     266            $command = sprintf('%s %s | %s %s | %s %s > %s/%s',
    264267                escapeshellcmd($this->anytopnm_binary),
    265                 escapeshellcmd($this->source_dir),
    266                 escapeshellcmd($file_name),
     268                escapeshellcmd($source_file),
    267269                escapeshellcmd($this->pnmscale_binary),
    268270                escapeshellcmd($pnmscale_args),
Note: See TracChangeset for help on using the changeset viewer.