public function reprocess()
{
if (!$this->originalFilename()) {
return;
}
foreach ($this->styles as $style) {
$fileLocation = $this->storage == 'filesystem' ? $this->path('original') : $this->url('original');
$file = FileFactory::create($fileLocation);
if ($style->dimensions && $file->isImage()) {
$file = $this->resizer->resize($file, $style);
} else {
$file = $file->getRealPath();
}
$filePath = $this->path($style->name);
$this->move($file, $filePath);
}
}