Image: Use OIIO for loading/saving WEBP format

This removes most of the low-level usage of libwebp in favor of using
OIIO directly. The thumbnail code remains the same as it's more
efficient to use the built-in scaling support there.

Added additional tests for lossless quality. No other changes to
features and performance are expected or noticed.

Note: the error message when saving unsupported large images is
suboptimal until the library update associated with #153493 is complete.

Pull Request: https://projects.blender.org/blender/blender/pulls/153567
This commit is contained in:
Jesse Yurkovich 2026-02-02 20:49:24 +01:00 • committed by Jesse Yurkovich
parent 68fc52180a
commit 952d2ed026
14 changed files with 61 additions and 133 deletions

View file

@ -253,9 +253,13 @@ class ImBufSaveTest(ImBufTest):
self.check(src="rgba08", ext="webp", settings={"file_format": "WEBP", "color_mode": "RGB", "quality": 90})
self.check(src="rgba08", ext="webp", settings={"file_format": "WEBP", "color_mode": "RGBA", "quality": 90})
self.check(src="rgba08", ext="webp", settings={"file_format": "WEBP", "color_mode": "RGB", "quality": 100})
self.check(src="rgba08", ext="webp", settings={"file_format": "WEBP", "color_mode": "RGBA", "quality": 100})
self.check(src="rgba32", ext="webp", settings={"file_format": "WEBP", "color_mode": "RGB", "quality": 70})
self.check(src="rgba32", ext="webp", settings={"file_format": "WEBP", "color_mode": "RGBA", "quality": 70})
self.check(src="rgba32", ext="webp", settings={"file_format": "WEBP", "color_mode": "RGB", "quality": 100})
self.check(src="rgba32", ext="webp", settings={"file_format": "WEBP", "color_mode": "RGBA", "quality": 100})
# autopep8: on