summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2013-03-22 19:37:02 +0000
committerChristopher Smith <chris@jalakai.co.uk>2013-03-22 19:37:02 +0000
commitf0b65004f2ff928562c2ffdfa31b4d1e4cff3ab7 (patch)
tree301e748f38a5f378da12d54838c0c29a475affd4
parentfd9d3278078df67aab6cee0c2b7b43a27f206983 (diff)
downloadrpg-f0b65004f2ff928562c2ffdfa31b4d1e4cff3ab7.tar.gz
rpg-f0b65004f2ff928562c2ffdfa31b4d1e4cff3ab7.tar.bz2
don't resize images when resize dimensions match native image dimensions
-rw-r--r--inc/media.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/inc/media.php b/inc/media.php
index 654d31cb4..fc4ad1d67 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -1795,6 +1795,9 @@ function media_resize_image($file, $ext, $w, $h=0){
// we wont scale up to infinity
if($w > 2000 || $h > 2000) return $file;
+ // resize necessary? - (w,h) = native dimensions
+ if(($w == $info[0]) && ($h == $info[1])) return $file;
+
//cache
$local = getCacheName($file,'.media.'.$w.'x'.$h.'.'.$ext);
$mtime = @filemtime($local); // 0 if not exists