Updating decode_gif to default to DISPOSE_DO_NOT to fix animated gif loading#9241
Conversation
…posal mode DISPOSAL_UNSPECIFIED or DISPOSAL_PREVIOUS. This fixes loading animated gifs with these modes set
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9241
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit a3054dc with merge base f5c6c2e ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @sg3-141-592! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
|
@sg3-141-592 thanks for putting this fix together! This is looking good. I only adjusted the linting. Feel free to fill the Contributor License Agreement and submit the PR for review! |
Sure CLA check should clear in the next hour |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Hey @AntoineSimoulin! You merged this PR, but no labels were added. |
There are errors loading animated gifs where the frame disposal method is set to DISPOSAL_UNSPECIFIED #9009
This is because when an animated gif has disposal mode
DISPOSAL_UNSPECIFIED,decode_gifis defaulting to "background" drawing mode. It needs to beDISPOSE_DO_NOTinstead where changes are overwritten onto the previous canvas. This is the default behaviour of web browsers and libraries like Pillow - GifImagePlugin.py.After this the example gif subsequent frames display correctly