Changeset 10570 for trunk/admin/include


Ignore:
Timestamp:
Apr 22, 2011, 3:19:36 PM (14 years ago)
Author:
patdenice
Message:

feature:2274
Create thumbnail through ajax.
Remove $conftn_width, $conftn_height and $conftn_compression_level parameters.

File:
1 edited

Legend:

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

    r10563 r10570  
    605605    // the image doesn't need any resize! We just copy it to the destination
    606606    copy($source_filepath, $destination_filepath);
    607     return true;
     607    return get_resize_result($source_filepath, $destination_filepath, $resize_dimensions['width'], $resize_dimensions['height'], $starttime, 'GD');
    608608  }
    609609 
     
    647647
    648648  // everything should be OK if we are here!
    649   return array(
    650     'source'      => $source_filepath,
    651     'destination' => $destination_filepath,
    652     'width'       => $resize_dimensions['width'],
    653     'height'      => $resize_dimensions['height'],
    654     'size'        => floor(filesize($destination_filepath) / 1024).' KB',
    655     'time'            => number_format((get_moment() - $starttime) * 1000, 2, '.', ' ').' ms',
    656     'library'     => 'GD',
    657   );
     649  return get_resize_result($source_filepath, $destination_filepath, $resize_dimensions['width'], $resize_dimensions['height'], $starttime, 'GD');
    658650}
    659651
     
    692684    // the image doesn't need any resize! We just copy it to the destination
    693685    copy($source_filepath, $destination_filepath);
    694     return true;
     686    get_resize_result($source_filepath, $destination_filepath, $resize_dimensions['width'], $resize_dimensions['height'], $starttime, 'ImageMagick');
    695687  }
    696688
     
    717709
    718710  // everything should be OK if we are here!
    719   return array(
    720     'source'      => $source_filepath,
    721     'destination' => $destination_filepath,
    722     'width'       => $resize_dimensions['width'],
    723     'height'      => $resize_dimensions['height'],
    724     'size'        => floor(filesize($destination_filepath) / 1024).' KB',
    725     'time'            => number_format((get_moment() - $starttime) * 1000, 2, '.', ' ').' ms',
    726     'library'     => 'ImageMagick',
    727   );
     711  return get_resize_result($source_filepath, $destination_filepath, $resize_dimensions['width'], $resize_dimensions['height'], $starttime, 'ImageMagick');
    728712}
    729713
     
    967951  return $file_path;
    968952}
     953
     954function get_resize_result($source_filepath, $destination_filepath, $width, $height, $time, $library)
     955{
     956  return array(
     957    'source'      => $source_filepath,
     958    'destination' => $destination_filepath,
     959    'width'       => $width,
     960    'height'      => $height,
     961    'size'        => floor(filesize($destination_filepath) / 1024).' KB',
     962    'time'            => number_format((get_moment() - $time) * 1000, 2, '.', ' ').' ms',
     963    'library'     => $library,
     964  );
     965}
    969966?>
Note: See TracChangeset for help on using the changeset viewer.