Make sure the path is correct. Try referencing the file using an absolute path. Otherwise, your file permissions may be incorrect.
May 1, 2019
5
Level 2
Image source not readable!
Hi,
I have an application which is using the intervention/image package. In my controller file AdminCoursesController.php I have a method show_signatories which I am using to retrieve an image from the 'certificate_logo' directory, located in my public directory. But when I try to retrieve it I am getting 'Image source not readable' error from the intervention/image package. I have checked the directory, and the image exists.
Code is listed below:
AdminCoursesController.php
public function show_signatories() {
$signatories = Signatory::all();
$inactive_signatories = Signatory::whereStatus(0)->get();
$certificate_logo = CertificateLogo::whereStatus(1)->get()->first();
if(empty($certificate_logo)) {
$certificate_logo = 'some-image.jpg';
}else{
$certificate_logo = $certificate_logo->path;
}
$file = Image::make('certificate_logo/' . $certificate_logo);
return $file->response('jpeg');
}
So, can you please help me debug what's causing this issue and how to resolve it?
Thanks
Please or to participate in this conversation.