I have the latest version installed in my Laravel 4 app, it works 80% of time time but for some reason certain JPG's cause it to throw a 500 error that says "Image source not readable". Any JPG from my Canon 7D DSLR causes that error. If I import the image to Photoshop and re-save it then it'll work just fine. But I've also found the same issue with quite a few images from the web. If I pick 10 images at random about 20% of them will fail consistently.
Seems like a bug.
It would be helpful if you could post a test image from your camera for us to try and reproduce the error with.
Thanks for reporting. Can you provide a image that is not readable? Also I would like to know if you are using GD or Imagick driver.

Here is a sample image that is creating this issue for me.
Sorry, I can't reproduce any error. It would be helpful, if you can provide the following infos with a report for this bug.
I also tried to load images from a Canon 7D DSLR (as @nathanfirth mentioned). And they worked also fine with GD and Imagick.
I am suddenly getting this error too.
Don't know if this will help anyone here, but I ran across a StackOverflow question regarding this error and while I was not having the same issue as the OP, it did clarify something for me . Maybe it will be of use someone here as well.
Using Laravel I was trying to call:
$image = Input::file('image');
// Other variables assigning
// stuff such as filename and extension
$thumb = Image::make($image)->resize($width, $height)->save($thumb_path . $filename);
It seems I overlooked the fact that I was trying to pass an object to Image::make() rather than the path to the image being processed.
The fix was just changing:
Image::make($image)
to
Image::make($image->getRealPath())
Stackoverflow reference article
Great app by the way! Really stoked that I managed to get it working, hopefully this will help anyone else having the same issue as myself. Maybe make a note about the usage in the Laravel section of the docs?
@DefrostedTuna I think what you describe has nothing to do with this problem.
However I added the possibility to init directly from a File Upload object.
I've had the same issue and fixed it by having
$image = Image::make(public_path($path));
instead of
$image = Image::make($path);
My problem was php_value upload_max_filesize and php_value post_max_size were lower than the size of the image I was uploading. I changed those values in php.ini and restarted apache, all good.
In order to help prevent this, I also added <input type="hidden" name="MAX_FILE_SIZE" value="20971520"> to my form.
Hi, was this issue fixed ? I am having this problem as well. Some images are readable and some are not, which is bizarre. My Laravel version is 4.2 and I am using the latest release of intervention. Here is one of the images that isn't working on my end:
does it have something to do with the file size or so? cheers!
@jedgueruela Just tested successfully with your image.
PHP 5.5.3, GD bundled (2.1.0 compatible)
memory_limit: 128M
require '../vendor/autoload.php';
use Intervention\Image\ImageManagerStatic as Image;
$img = Image::make('285f2ef4-929b-11e4-9499-09c86683767a.JPG')
$img->widen(300);
echo $img->response('jpg');
What is the error message? Any info in your php log file?
hi @olivervogel . just found out that the issue was not on the intervention/image library but on laravel's getRealPath(). seems like it isn't accepting greater than 2mb image size. @SilverPaladin 's solution is the right one in my case. thanks for the help.
Just a quick note : if you are using it with Laravel, make sure that the path you are trying to write the image is readable and reachable. Even if you use public_path() make sure that it's properly set up in bootstrap/paths.php
am haivng the same issues
I got the same problem "NotReadableException in AbstractDecoder.php line 302", and it's fixed!
In my case, Image::make(directory), the directly need the full the directory. So add the rest to the url which is:
Image::make('/var/www/test'.$this->path)
->fit(200)
->save('/var/www/test'.$this->thumbnail_path);
And it works! :D
I had Issue in Windows Operating System . When i had uploaded image file its Works Fine on Linux Maschine . But when i try to run Same Code on My Windows Maschine it will Be thrown below error.
Encoding format(tmp) is not supported.
i had checked in AbstractEncoder.php on Line no 150 and found that there is not such case for tmp in linux they dont append tmp while in windows they append tmp extension to image file
So please its humble request to give some sollution to that so code is become more elegant and cross platform So we can utilize it.
Thanks
just met this issue. spent two hours and finally find @SilverPaladin 's solution. thank you so much for saving my life.
I seem to be having this error when uploading from a mobile device Chrome browser - not when accessing it from the PC.
Same here,
works on mac with chrome.
But not on my iphone. tested in mobile safari and chrome.
Any ideas?
I had the same problem, getting 'Image source not readable'. I could open the image in browser but not in php. So, my fix was adding file_get_contents inside Image::make().
Be aware, file_get_contents does not accept spaces so you need to replace them with %20. My final code is this;
$path = str_replace(' ', '%20',$path);
$image = Image::make( file_get_contents($path) );
Thanks @SilverPaladin
And thank you @JCWolf.
I was trying this:
$img = Image::make("http://homestead.app/storage/media/image1.jpg");
Which produced the not readable error. So I tried JCWolf's solution:
$img = Image::make(file_get_contents(str_replace(' ', '%20',"http://homestead.app/storage/media/image1.jpg")))
And it works.
I had this happen when attempting to load a local file using a full path. For some reason, is_file() on AbstractDecoder.php#L194 was returning false, although that file definitely existed. I tried substituting it with file_exists(), but that returned false as well.
I'm guessing that it has something to do with file or directory tree permissions, but I didn't bother digging further. As a work-around, I used Laravel's Storage::get to retrieve file contents, and passed them to ImageManger::make. Here's an example:
$files = Storage::files( 'images' );
foreach( $files as $file )
{
// Passing this to $manager->make() wasn't working for me:
// $path = storage_path() . '/' . $file
$contents = Storage::get( $file );
$manager = new ImageManager( array('driver' => 'imagick') );
$image = $manager->make( $contents );
}
Hope this helps someone.
In my case, this was happening because I was moving the file to storage before I manipulated it silly error I know! Meaning using IlluminateHttpUploadedFile::move() or move_uploaded_file. So when I called Image::make($file->getRealPath()), it was unable to read it.
So much thanks to @SilverPaladin !
Meet the issue again!
So much thanks to @SilverPaladin again!
Btw, it will be great if the error message in this exception can be more expressive.
Most helpful comment
My problem was
php_value upload_max_filesizeandphp_value post_max_sizewere lower than the size of the image I was uploading. I changed those values in php.ini and restarted apache, all good.In order to help prevent this, I also added
<input type="hidden" name="MAX_FILE_SIZE" value="20971520">to my form.