DeltaHF
Well-known member
- Affected version
- 2.3
The image-to-WebP conversion feature in XenForo 2.3 incorrectly rasterizes certain valid SVG files, causing the loss of their vector data. The behavior is inconsistent and appears to be triggered when an SVG file contains only a single color without an explicit transparent background.
This issue can be observed with two nearly identical SVG files, where the only difference is the fill color. An SVG with a blue fill is preserved correctly, while an SVG with a white fill is rasterized into a WebP image. I am using the GD image library and have not tested this with ImageMagick, but this can be reproduced here on the official forums as well.
I have provided sample SVG files which are affected by this below. The two SVG files are identical aside from
SVGs should be excluded from the WebP conversion pipeline, as users would be uploading SVGs specifically for their vector properties.
This issue can be observed with two nearly identical SVG files, where the only difference is the fill color. An SVG with a blue fill is preserved correctly, while an SVG with a white fill is rasterized into a WebP image. I am using the GD image library and have not tested this with ImageMagick, but this can be reproduced here on the official forums as well.
I have provided sample SVG files which are affected by this below. The two SVG files are identical aside from
fill="#fff"
in WHITE.svg and fill="#00f"
in BLUE.svg. The original files are included together in the zip file to show them before processing. As you can see from the resulting attachments, WHITE.svg has been compressed while BLUE.svg retains its original file size. You can also download and view the files in a text editor to confirm the processing.SVGs should be excluded from the WebP conversion pipeline, as users would be uploading SVGs specifically for their vector properties.