diff --git a/classes/ImageResizer.php b/classes/ImageResizer.php index 9d02241..9194878 100644 --- a/classes/ImageResizer.php +++ b/classes/ImageResizer.php @@ -90,8 +90,10 @@ class ImageResizer private function generateVersions(): void { + $compressor = $this->file->compressor(); + foreach ($this->possibleSizes() as $size) { - $this->file->compressor()->resize($size, $this->update, function($media, $file) { + $compressor->resize($size, $this->update, function($media, $file) { if (!file_exists($file)) { throw new ResizerException('File versions cannot be generated. Version file "'.$file.'" of "'.$this->file->root().'" doesnt exist.'); }