Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

wizjo's avatar
Level 26

Intervention Image "Image source not readable " error

What I`m trying to do is to:

  1. Upload photo and store it`s path to database:
$addition->thumbnail = $request->file('thumbnail')->store('dodatki', 'public');
$addition->save(); //that works and I have path in my db: dodatki/KZuizWcAQPIGYy1gEhM0NcPat2VxqcESENooYeub.jpeg
  1. retrieve photo from database and make Intervention Image instance to perform further actions on photo.
//I can do this so I can see my photo in view
$filename = Storage::url($this->attributes['thumbnail']);
return '<img src="'.asset($filename).'"/>';

//but I cannot create Intervention Image object in any way giving path to it:
$img = Image::make($this->attributes['thumbnail']); 
$img = Image::make(Storage::url($this->attributes['thumbnail']));
//two above gives an error: "Image source not readable"

$img = Image::make(asset(Storage::url($this->attributes['thumbnail'])));
//this makes page cannot load - it keeps loading all the time

It is worth mentioning that I created symbolic link: php artisan storage:link.

0 likes
3 replies
michaeldrennen's avatar

I would check the path you are passing into...

Image::make()

Can you pass a hard coded path into Image::make() to a test image that you manually put on your disk?

michaeldrennen's avatar

Oh. Well try disabling a limit on execution time.

ini_set('max_execution_time', 0);

The real culprit of the long execution time might be a little harder to nail down.

  • test big images vs small images (a limit of how fast the library can work on your current box)
  • test pulling the image file from different networks (a throughput issue)

If you are trying to get execution times to be super fast, you might need a beefier box or store the file locally or perhaps DNS lookups are slow...

Please or to participate in this conversation.