Throw exception if resized image cannot be found before compression

This commit is contained in:
philipp lang 2021-10-30 23:08:27 +02:00
parent 1bd0dff59b
commit f7e7e46c02
1 changed files with 3 additions and 0 deletions

View File

@ -93,6 +93,9 @@ class ImageResizer
}
foreach ($this->file->versions() as $version) {
if (!$this->disk->exists($version->get('path'))) {
throw new ResizerException('File versions cannot be generated. Version file "'.$version->get('path').'" of "'.$this->file->root().'" doesnt exist.');
}
$this->file->compressor()->make($this->disk->path($version->get('path')));
}
}