Confirmed Image optimisation fails with gd-webp encoding failed

Could you share some details? Is this a regression in 2.3.3 or has it never worked correctly in 2.3.x? Does it affect all conversions or is it just a potential crash?

I'm still on 2.3.2 and did the conversion today. With the exception of messages like libpng warning: iCCP: known incorrect sRGB profile nothing appears to have broken.
 
It's specific to certain images. The issue is that we don't catch certain errors from imagewebp/imagecreatefromwebp and skip over these images. This particular error is a warning, but at least one seems to be a fatal error where our opportunities for error handling are limited. In the latter case I think we'll need to try to skip the image the next time optimization runs, but we can't avoid the process crashing :(.
 
This is an error I reported. The failure occurs for any attachments that are 7mb or larger. The workaround I am doing is deleting/resizing those images from the forum posts and then having to delete the .data file in the internal_data_/attachments folder to the corresponding file. The job will continue running until the next 7mb+ file it encounters and fails. Repeat steps. My forum has over 20k attachments so this process is taking many days to finish.

I was on Xenforo 2.3.2 and upgraded to 2.3.3. Server php version is on 8.3.10.
 
It's specific to certain images. The issue is that we don't catch certain errors from imagewebp/imagecreatefromwebp and skip over these images. This particular error is a warning, but at least one seems to be a fatal error where our opportunities for error handling are limited. In the latter case I think we'll need to try to skip the image the next time optimization runs, but we can't avoid the process crashing :(.
@Chris D is there any way I could bypass this error? I can't continue the optimization due to it
 
What version of PHP are you using? The errors should no longer be fatal in PHP 8.2.22+ and PHP 8.3.10+.
 
You can try replacing line 224 of /src/XF/Image/Gd.php with:

PHP:
        $success = @imagewebp($this->image, $file, $quality);
 
And the error is a warning (E_WARNING), rather than a fatal error? You might want to try using Imagick instead. Otherwise you can try marking the problem file as optimized manually, and then running the tool again.

SQL:
SELECT data_id 
FROM xf_attachment_data 
WHERE optimized = 0 
ORDER BY data_id 
LIMIT 1;

SQL:
UPDATE xf_attachment_data
SET optimized = 1
WHERE data_id = 123; -- replace 123 with the data_id from the query above
 
Back
Top Bottom