[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-08-24 11:27:40 +00:00
parent 658b60e3a3
commit a3e3639a59
2 changed files with 5 additions and 2 deletions

View File

@ -164,7 +164,8 @@ class TestFileWebp:
with pytest.raises(ValueError) as e:
im.save(temp_file)
assert (
str(e.value) == "encoding error 5: Image size exceeds WebP limit of 16383 pixels"
str(e.value)
== "encoding error 5: Image size exceeds WebP limit of 16383 pixels"
)
def test_WebPEncode_with_invalid_args(self) -> None:

View File

@ -676,7 +676,9 @@ WebPEncode_wrapper(PyObject *self, PyObject *args) {
char message[50] = "";
if (error_code == VP8_ENC_ERROR_BAD_DIMENSION) {
sprintf(
message, ": Image size exceeds WebP limit of %d pixels", WEBP_MAX_DIMENSION
message,
": Image size exceeds WebP limit of %d pixels",
WEBP_MAX_DIMENSION
);
}
PyErr_Format(PyExc_ValueError, "encoding error %d%s", error_code, message);