You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you run the Docker image, you get hit with the following:
Attaching to lastfm-twitter_bot_1
bot_1 | - Scraping from last.fm...
bot_1 | - Generating collage...
bot_1 |
bot_1 | Fatal error: Uncaught Intervention\Image\Exception\NotReadableException: Unable to init from given binary data. in /opt/tbot/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php:131
bot_1 | Stack trace:
bot_1 | #0 /opt/tbot/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php(82): Intervention\Image\Gd\Decoder->initFromBinary('\xFF\xD8\xFF\xE0\x00\x10JFIF\x00\x01\x01\x00\x00...')
bot_1 | #1 /opt/tbot/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php(335): Intervention\Image\AbstractDecoder->initFromUrl('https://lastfm....')
bot_1 | #2 /opt/tbot/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php(66): Intervention\Image\AbstractDecoder->init('https://lastfm....')
bot_1 | #3 /opt/tbot/vendor/intervention/image/src/Intervention/Image/ImageManager.php(54): Intervention\Image\AbstractDriver->init('https://lastfm....')
bot_1 | #4 /opt/tbot/vendor/intervention/image/src/Intervention/Image/ImageManagerStatic.php(58): Intervention\Image\ImageManager->make('https://lastfm....')
bot_1 | #5 /opt/tbot/vendor/tzsk/collage/src/Con in /opt/tbot/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php on line 131
lastfm-twitter_bot_1 exited with code 255
Presumably this is coming from the fact the Collage process is fed image URLs, rather than a local system or binary collection. Might need to rejig the import handler to see why this doesn't work. When tried on a local system running Kubuntu 20.04, it works fine.
There's this function in vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php:
/** * Initiates new image from binary data * * @param string $data * @return \Intervention\Image\Image */publicfunctioninitFromBinary($binary)
{
$resource = @imagecreatefromstring($binary);
if ($resource === false) {
thrownewNotReadableException(
"Unable to init from given binary data."
);
}
$image = $this->initFromGdResource($resource);
$image->mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $binary);
return$image;
}
imagecreatefromstring appears to be returning false on webp in my Docker image. This implies a problem with the libgd library provided with the underlying container OS than a problem with the code itself.
I've replaced the Docker build with CentOS 7. Rather a dramatic change, but since I'm (at least now) the only user and the mainline PHP build has problems I can use that + remirepo from familiarity.
This now works on Intel/AMD. Yet to test on ARM, but issue can be closed for now.
When you run the Docker image, you get hit with the following:
Presumably this is coming from the fact the Collage process is fed image URLs, rather than a local system or binary collection. Might need to rejig the import handler to see why this doesn't work. When tried on a local system running Kubuntu 20.04, it works fine.
Possibly related: Intervention/image#634
The text was updated successfully, but these errors were encountered: