XF 2.3 Error with image optimization

DocZaius

Member
So when I try to convert existing attachments to webp through the new image optimization tool, it processes around 300 attachments and then I get this error:

  • ErrorException: Fatal Error: gd-webp encoding failed
  • src/XF/Image/Gd.php:224
  • Generated by: DocZaius
  • Jul 5, 2024 at 7:22 AM

Stack trace​

#0 [internal function]: XF::handleFatalError()
#1 {main}

Request state​

array(4) {
["url"] => string(24) "/admin.php?tools/run-job"
["referrer"] => string(56) "https://alligatorunderground.com/admin.php?tools/run-job"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(3) {
["_xfRedirect"] => string(10) "/admin.php"
["_xfToken"] => string(8) "********"
["only_ids"] => string(0) ""
}
}

Can anyone tell me anything about how to fix this? Or to get the system to ignore it and keep processing the attachments?

Thanks in advance.
 
Tried with the CLI and it got through 262 attachments then just stopped.

Tried switching to Imagick, but my host doesn't have webp support included with it. So I'm stuck with gd.

Anyone?
 
My host has upgraded and Imagick now has webp support! Imagine my excitement!

And then imagine my disappointment when it didn't work with Imagick, either. It just gave me a vague 500 error and there's nothing useful in the error log.

So I guess it's just a mystery.
 
Man, I wish I knew what the problem is.

It always errors out after it hits the number 243.

So I figure, maybe there's a problem with a particular attachment. So I went through the attachment browser and I found all the cases where the link to the attachment was broken and deleted those. Then, I went through all the larger jpg files (greater than 5MP) and manually converted them to webp just in case the size of the file had anything to do with it.

Nothing changes.

I do have some larger GIFs and MP4s, but this tool shouldn't be touching those at all, right?
 
Ok, just an update for those few who might be affected by the same issue. It's definitely a situation where some process on my server is timing out, so I've been either deleting or manually optimizing (i.e., editing individual posts and manually converting the images to webp, one by one) - all JPGs over 5MB.

And I'm making progress. It no longer stops after 243 - I got it up to 485 before it quit on me.

So I went ahead and got rid of jpgs over 4MB in size, and right now it's up to 733 and still processing without dropping an error page on me.

If you're having this problem, I recommend you browse your attachments in the Admin panel, sort by size and see if you can do something about the larger JPG files. That might fix it for you.

Thanks to @AndyB for helping me sort this out.
 
Back
Top Bottom