Skip to content

Commit

Permalink
Update Image.php
Browse files Browse the repository at this point in the history
  • Loading branch information
matteotrubini committed Sep 17, 2019
1 parent 98314c2 commit 6661a19
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions classes/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ public function resize($width = false, $height = false, $options = [])
$this->compressWithTinyPng();
}

// Touch the cached image with the original file mime time, so
// it get cached correctly.
// Touch the cached image with the original mtime to align them
touch($this->getCachedImagePath(), filemtime($this->filePath));
}

Expand Down Expand Up @@ -241,7 +240,7 @@ protected function compressWithTinyPng()

/**
* Checks if the requested resize/compressed image is already cached.
* Removes the cached image if the original image is newer.
* Removes the cached image if the original image has a different mtime.
*
* @return bool
*/
Expand All @@ -252,7 +251,7 @@ protected function isImageCached()
return false;
}

// if cached image is newer than source file, the image is already cached
// if cached image mtime match, the image is already cached
if (filemtime($this->filePath) === filemtime($cached_img)) {
return true;
}
Expand Down

0 comments on commit 6661a19

Please sign in to comment.