You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some experimentation this approach worked as expected, however I then got intermittent errors with jpegs. Occasionally throwing an error here stating that cost was None.
This seems to boil down to the registry trying to figure out how it can convert a JPEGImageFile to a GIFImageFile, and adding the following has fixed it for our usecase:
for image_class in registry.get_image_classes():
if image_class is GIFImageFile:
break
registry.register_converter(image_class, GIFImageFile, None, float("inf"))
I'm unsure if you intended for register_operation to be used in this way, but it seems quite useful and am happy to work on a pull request to remove the need for the register_converter stuff and add tests.
The text was updated successfully, but these errors were encountered:
Recently I tried to make Wagtail use gifsicle when resizing gifs, rather than wand and imagemagik as it seemed to be quicker at it.
I thought I could do this by adding the following code with implementations of the functions that just called the gifsicle cli:
After some experimentation this approach worked as expected, however I then got intermittent errors with jpegs. Occasionally throwing an error here stating that
cost
wasNone
.This seems to boil down to the registry trying to figure out how it can convert a
JPEGImageFile
to aGIFImageFile
, and adding the following has fixed it for our usecase:I'm unsure if you intended for
register_operation
to be used in this way, but it seems quite useful and am happy to work on a pull request to remove the need for theregister_converter
stuff and add tests.The text was updated successfully, but these errors were encountered: