Bug in constructor of Image.php #225
Replies: 4 comments 7 replies
-
You can change the image drive before loading the image: \Spatie\Image\Image::useImageDriver(ImageDriver::Gd)
->loadFile('example.jpg') |
Beta Was this translation helpful? Give feedback.
-
I am getting the same error
According to 1 snipet. it doesn't use class properly imageDriver According this documentation it should be My offre is fix in class, or create config for lib. To be able to change Driver via config. |
Beta Was this translation helpful? Give feedback.
-
I could make it work but instead of load I had to use loadFile. Maybe error in documentation |
Beta Was this translation helpful? Give feedback.
-
Hello, $this->imageDriver = new ImagickDriver; with $this->imageDriver = new GdDriver; This is because the GD library is an extension that is always present in a PHP installation, whereas Imagick is not. As a result, even if the driver is changed using the static method useImageDriver, the constructor still throws an exception in PHP installations that do not have Imagick. Can this be fixed in the next release? Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
On line 31 of Image.php, there is a reference to ImagickDriver. However, if I choose to use a different imageDriver, this line is still loaded. I don't have ImagickDriver installed, so I keep getting a class not found error. I don't have enough knowledge to fix this problem (I changed it to new GdDriver() for now, but I should be dynamic.
Beta Was this translation helpful? Give feedback.
All reactions