# HG changeset patch # User Dan Fuhry # Date 1347729419 14400 # Node ID 68c17d935750bbbe2a869381b84ea30acf4aeb33 # Parent f1ed3e9298aebd1710e3527ae678154819f0a893# Parent 26e80700ff1d8e787818bd88fac76b17299767f0 Merged diff -r f1ed3e9298ae -r 68c17d935750 includes/functions.php --- a/includes/functions.php Sat Sep 15 13:18:01 2012 -0400 +++ b/includes/functions.php Sat Sep 15 13:16:59 2012 -0400 @@ -4268,6 +4268,7 @@ { die('SECURITY: ImageMagick path is screwy'); } + $magick_path = escapeshellcmd($magick_path); $cmdline = "$magick_path $in_file_sh -resize \"{$width}x{$height}>\" $out_file_sh"; system($cmdline, $return); if ( !file_exists($out_file) ) @@ -4291,7 +4292,7 @@ else if ( $ratio < 1 ) { // orig. height is greater than width - $new_width = round( $height / $ratio ); + $new_width = round( $height * $ratio ); $new_height = $height; } else if ( $ratio == 1 ) @@ -4313,6 +4314,13 @@ if ( !$oldimage ) throw new Exception('GD: Request to load input image file failed.'); + if ( $file_ext == 'png' || $file_ext == 'gif' ) + { + imagecolortransparent($newimage, imagecolorallocatealpha($newimage, 0, 0, 0, 127)); + imagealphablending($newimage, false); + imagesavealpha($newimage, true); + } + // Perform scaling imagecopyresampled($newimage, $oldimage, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig); diff -r f1ed3e9298ae -r 68c17d935750 includes/template.php --- a/includes/template.php Sat Sep 15 13:18:01 2012 -0400 +++ b/includes/template.php Sat Sep 15 13:16:59 2012 -0400 @@ -1472,7 +1472,7 @@ $f = microtime_float(); $f = $f - $_starttime; - $f = round($f, 2); + $f = sprintf("%.02f", $f); $t_loc = $lang->get('page_msg_stats_gentime_short', array('time' => $f)); $t_loc_long = $lang->get('page_msg_stats_gentime_long', array('time' => $f)); diff -r f1ed3e9298ae -r 68c17d935750 plugins/SpecialUpdownload.php --- a/plugins/SpecialUpdownload.php Sat Sep 15 13:18:01 2012 -0400 +++ b/plugins/SpecialUpdownload.php Sat Sep 15 13:16:59 2012 -0400 @@ -250,7 +250,7 @@ $extension = ".{$_GET['fmt']}"; $cache_filename = ENANO_ROOT . "/cache/{$filename}-{$row['time_id']}-{$width}x{$height}$extension"; - if ( file_exists($cache_filename) ) + if ( file_exists($cache_filename) && !isset($_GET['cache_override']) ) { $fname = $cache_filename; } @@ -281,7 +281,7 @@ } if ( $allow_scale ) { - $result = scale_image($orig_fname, $fname, $width, $height); + $result = scale_image($orig_fname, $fname, $width, $height, isset($_GET['cache_override'])); if ( !$result ) $fname = $orig_fname; }