plan2net / webp

Create a WebP copy for images (TYPO3 CMS)
GNU General Public License v3.0
60 stars 33 forks source link

TypeError: Return value of parseStripColorProfileCommand() must be an instance of Plan2net\Webp\Converter\mixed, string returned #101

Closed christianbltr closed 3 months ago

christianbltr commented 5 months ago

PHP: 7.4.3 TYPO3: 11.5.36 webp: 4.3.1

When trying to edit a content element, the following error appears:

Return value of Plan2net\Webp\Converter\MagickConverter::parseStripColorProfileCommand() must be an instance of Plan2net\Webp\Converter\mixed, string returned

Auswahl_158

christianbltr commented 5 months ago

Seems to be that this is a regression wich was introduced with the bugfix for https://github.com/plan2net/webp/issues/98

Downgrading to webp 4.2.0 fixes the issue

muellerlukas1809 commented 4 months ago

Hey @christianbltr , it might be due to your PHP version.

From what I understand, the return value "mixed" was introduced in PHP 8.0. I encountered the same error using version 4.3.1 with PHP 7.4, which is currently out of official security support.

The requirement specified in the composer.json file for version 4.3.1 is "php": ">=7.2.0". If my assumption is correct, perhaps we could submit a pull request to raise the PHP requirement?

christianbltr commented 4 months ago

Yes I would also assume that this is caused by the PHP version. Raising the PHP version would at least prevent composer from installing the latest version on those systems. But composer would still try to install 4.3.1 because this version says it will run under PHP 7.4. So I think it would be the best to have at least one version which will run flawlessly under PHP 7.4 before raising the PHP requirement in the next version. Otherwise other users will end up here also because they try to install webp 4.3.1 on systems with PHP 7.4.

wazum commented 3 months ago

I pushed a new version 4.3.2