I'm trying to get the first page of a .pdf and convert it to a .jpg
. So this is my initial code:
public function setFile(UploadedFile $file = null)
{
$filename = sha1(uniqid(mt_rand(), true)) . '.jpg';
$file->move('catalogues', $filename);
$this->setFileName($filename);
$im = new \Imagick('/catalogues/' . $filename);
die("here I die");
The problem: I get this error:
unable to open image `/catalogues/0cd10cccf88d80295eba12ef56423f9184dde1c4.jpg': No such file or directory @ error/blob.c/OpenBlob/2638
I can not understand it, since I have the file at docuement_root/catalogues/0cd10cccf88d80295eba12ef56423f9184dde1c4.jpg
.