Skip to content

Commit

Permalink
don't resize images when resize dimensions match native image dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris--S committed Mar 22, 2013
1 parent fd9d327 commit f0b6500
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inc/media.php
Expand Up @@ -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
Expand Down

0 comments on commit f0b6500

Please sign in to comment.