image icon indicating copy to clipboard operation
image copied to clipboard

Issue with instantiating Driver

Open giedrius opened this issue 4 years ago • 3 comments

Hello,

production.ERROR: Driver (imagick) could not be instantiated. {"exception":"[object] (Intervention\Image\Exception\NotSupportedException(code: 0): Driver (imagick) could not be instantiated. at ....vendor/intervention/image/src/Intervention/Image/ImageManager.php:115)

The issue is caused by the fact, that driver has to be specified in lowercase in laravel config, and Intervention/Image tries to ucfirst it and look for the folder. However, if application is some locales (probably Japanese in my case), ucfirst returns the string without change (lowercase) and driver search fails. Ucfirst should be changed to locale-independent way.

giedrius avatar Feb 25 '21 19:02 giedrius

As a workaround

  • does it work specifying the the driver already correctly spelled? My impression it's really only used within \Intervention\Image\ImageManager::createDriver
  • seems the driver also supports providing an instance (though that might be problem with caching of the config)

mfn avatar Feb 27 '21 19:02 mfn

No, actually it does not work when correctly spelled in my case, it fails on another package then ( Driver must be gd or imagick. Imagick provided. {"exception":"[object] (Spatie\Image\Exceptions\InvalidImageDriver(code: 0): Driver must be gd or imagick. Imagick provided.). As a workaround, I try to reset locales to ones where ucfirst is working and processing images on separate work queue from anything, that requires me to change locale.

giedrius avatar Feb 27 '21 22:02 giedrius

I've used the example on the website and had gotten the same exception. I changed imagick to Imagick with uppercase(first letter). It worked.

mitsh avatar Feb 03 '22 02:02 mitsh

I've used the example on the website and had gotten the same exception. I changed imagick to Imagick with uppercase(first letter). It worked.

This is working for me too. Just search for 'imagick' and change it everywhere in your code.

theposeidonas avatar Nov 05 '22 14:11 theposeidonas

This issue should no longer occur in version 3.

olivervogel avatar Dec 08 '23 14:12 olivervogel