From f90077154f99b6e8a2f85e27d87851d073949093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 5 Jul 2013 11:12:22 +0200 Subject: [PATCH] Don't upscale the images larger than the original. --- fetch.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fetch.php b/fetch.php index d03f962..1b31b91 100644 --- a/fetch.php +++ b/fetch.php @@ -40,6 +40,7 @@ $h = $size[1]; //set new size $nw = $_GET["width"]; + if ($nw > $w) { break; } $nh = ($nw*$h)/$w; } else{ @@ -65,6 +66,7 @@ $h = $size[1]; //set new size $nh = $_GET["height"]; + if ($nh > $h) { break; } $nw = ($nh*$w)/$h; } else{