Closed S1SYPHOS closed 4 years ago
Thanks for raising it. However, would you mind telling how you managed to trigger that error? I have used this on quite a few projects and never seen that one.
I called the snippet through a file method. The file method resides in a plugin folder and is included by that plugin folder's index.php
with 'fileMethods' => require_once 'file.php'
Hrmm... but what i dont understand is that line is inside a files that included into the top of index.php should work without that.
But maybe your file method cant see it becuase it's outside my plugin?
@S1SYPHOS The plugin does have a bunch of filemethods built in. The ->toWebp()
will convert an image to webp on the fly in template if you already had images on the site before installing plugin.
https://github.com/HashandSalt/kirby3-webp/blob/master/index.php#L42
This method seems only available in some places, too ..
I gotta investigate further. Totally weird and first time something like this happened!
.. but I seem to be the only one having this problem so far, right?
@S1SYPHOS Actually somone else raised it with me yesterday. My hunch is that its a PHP 7.4 issue. Ive certainly not seen it with 7.2 or 7.3. That library is loaded in the file that is included at the top of the index PHP file, so its really odd that it cant see it.
Maybe 7.4 is stricter in the way that dependencies are included. I dont know.
Am I right to assume that it certainly doesn't hurt to include it, then :B ?
Thanks @S1SYPHOS!, I had the same issue, and fix it by adding use WebPConvert\Convert\Converters\Stack;
, would be nice to have it in the next release
@HashandSalt should I open a PR then or .. ;)
Should be fixed now.
Hey there, I get an error when using your fantastic lib, and it's fixed when I
use WebPConvert\Convert\Converters\Stack;
in the mainindex.php
Cheers! S1SYPHOS