diff --git a/transformation_wrapper.php b/transformation_wrapper.php index 23a8107f5d..ac0b04973d 100644 --- a/transformation_wrapper.php +++ b/transformation_wrapper.php @@ -30,9 +30,6 @@ require_once './libraries/db_table_exists.lib.php'; $request_params = array( 'cn', 'ct', - 'newHeight', - 'newWidth', - 'resize', 'sql_query', 'transform_key', 'where_clause' @@ -102,11 +99,11 @@ if (isset($ct) && ! empty($ct)) { PMA_downloadHeader($cn, $mime_type); -if (! isset($resize)) { +if (! isset($_REQUEST['resize'])) { echo $row[$transform_key]; } else { // if image_*__inline.inc.php finds that we can resize, - // it sets $resize to jpeg or png + // it sets the resize parameter to jpeg or png $srcImage = imagecreatefromstring($row[$transform_key]); $srcWidth = ImageSX($srcImage); @@ -114,20 +111,20 @@ if (! isset($resize)) { // Check to see if the width > height or if width < height // if so adjust accordingly to make sure the image - // stays smaller then the $newWidth and $newHeight + // stays smaller than the new width and new height - $ratioWidth = $srcWidth/$newWidth; - $ratioHeight = $srcHeight/$newHeight; + $ratioWidth = $srcWidth/$_REQUEST['newWidth']; + $ratioHeight = $srcHeight/$_REQUEST['newHeight']; if ($ratioWidth < $ratioHeight) { $destWidth = $srcWidth/$ratioHeight; - $destHeight = $newHeight; + $destHeight = $_REQUEST['newHeight']; } else { - $destWidth = $newWidth; + $destWidth = $_REQUEST['newWidth']; $destHeight = $srcHeight/$ratioWidth; } - if ($resize) { + if ($_REQUEST['resize']) { $destImage = ImageCreateTrueColor($destWidth, $destHeight); } @@ -139,10 +136,10 @@ if (! isset($resize)) { $destHeight, $srcWidth, $srcHeight ); - if ($resize == 'jpeg') { + if ($_REQUEST['resize'] == 'jpeg') { ImageJPEG($destImage, null, 75); } - if ($resize == 'png') { + if ($_REQUEST['resize'] == 'png') { ImagePNG($destImage); } ImageDestroy($srcImage);