Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support non-ascii gradient data #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhangbenber
Copy link

When effect path (composition names, layer names, etc.) contains CJK characters, the extension failed to parse gradient data and exported black-and-whites. The bug was reported on airbnb/lottie-web#1201. This commit fixes it by adding support for parsing non-ascii gradient data.

In my test aep files, these characters are utf-8 encoded. However, reading the file with encoding = 'UTF-8' failed because of binary data out of utf-8 byte ranges. Conversely, I tried to read the file as binary string and encode shapeNavigations the same way, so that we can find the correct gradientIndex.

Tested on After Effects 2021 (18.0.0) for MacOS. Both of AE and OS are Chinese version. Here is the demo aep file.

Chinese gradient demo.aep.zip

Before:
image

After:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant