/** * Process the queuedForWrite que. * * @return void */ protected function flushWrites() { foreach ($this->queuedForWrite as $style) { if ($style->value && $this->uploadedFile->isImage()) { $file = $this->resizer->resize($this->uploadedFile, $style); } else { $file = $this->uploadedFile->getRealPath(); } // Only move it real if ($filePath = $this->path($style->name)) { $this->move($file, $filePath); } } $this->queuedForWrite = []; }
/** * Resize an image to an exact width and height. * * @param UploadedFile $file * @param string $width - The image's new width. * @param string $height - The image's new height. * * @return \stdClass */ protected function resizeExact(UploadedFile $file, $width, $height) { return $this->imagine->open($file->getRealPath())->resize(new Box($width, $height)); }