bodymovin-extension icon indicating copy to clipboard operation
bodymovin-extension copied to clipboard

Support non-ascii gradient data

Open zhangbenber opened this issue 3 years ago • 0 comments

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 https://github.com/airbnb/lottie-web/issues/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

zhangbenber avatar Dec 17 '21 11:12 zhangbenber