Open suiqa opened 5 years ago
did you install the dependencies?
pip3 install -r requirements.txt
yes
LOL, this is the first issue and it's still relevant.
╭─pedrohlc at pc in /tmp/giftolottie (master ✔)
╰─λ pip install --user -r requirements.txt
Requirement already satisfied: kaitaistruct in /home/pedrohlc/.local/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (0.9)
Requirement already satisfied: svgwrite in /home/pedrohlc/.local/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (1.4)
Requirement already satisfied: numpy in /home/pedrohlc/.local/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (1.19.4)
╭─pedrohlc at pc in /tmp/giftolottie (master ✔)
╰─λ python read.py /tmp/tenor.gif uselessgoddess.tgs
gifsicle:/tmp/tenor.gif: warning: GIF too complex to unoptimize
(The reason was local color tables or complex transparency.
Try running the GIF through ‘gifsicle --colors=255’ first.)
gifsicle: warning: too many colors, using local colormaps
(You may want to try ‘--colors 256’.)
Traceback (most recent call last):
File "read.py", line 22, in <module>
frames, exts, image_specs = vendor.gif2numpy.convert(tmpfile.name, BGR2RGB=False)
File "/tmp/giftolottie/vendor/gif2numpy.py", line 629, in convert
np_image = np.array([local_color_table[byt] if byt != exts[-1]['transparent_idx'] else (254, 0, 254) for byt in uncompressed])
File "/tmp/giftolottie/vendor/gif2numpy.py", line 629, in <listcomp>
np_image = np.array([local_color_table[byt] if byt != exts[-1]['transparent_idx'] else (254, 0, 254) for byt in uncompressed])
TypeError: 'ColorTable' object is not subscriptable
╭─pedrohlc at pc in /tmp/giftolottie (master ✔)
╰─λ python --version
Python 3.8.6
It seems to be specific for the first GIF I tried, others are working!
Compress your GIF using gifsicle
$ gifsicle --colors=255 /path/to/source.gif /path/to/output.gif
It works for me.
Wow, I didn't even realize for years that there is some activity in the issue tracker, as GitHub did not send e-mail notifications about new issues. Pretty sorry about it. Glad to see that the community mostly managed to organize without my attention.
@PedroHLC the GIF you tried is pretty large, the project provides sane results only for tiny ones, which is described in README. And as Telegram now supports WebM stickers natively, I suppose it's outdated now, unless someone needs Lottie animations for some other software.
root@loli:~/giftolottie# python3 read.py tenor.gif test.tgs gifsicle:tenor.gif: warning: GIF too complex to unoptimize (The reason was local color tables or complex transparency. Try running the GIF through ‘gifsicle --colors=255’ first.) gifsicle: warning: too many colors, using local colormaps (You may want to try ‘--colors 256’.) Traceback (most recent call last): File "read.py", line 22, in
frames, exts, image_specs = vendor.gif2numpy.convert(tmpfile.name, BGR2RGB=False)
File "/root/giftolottie/vendor/gif2numpy.py", line 629, in convert
np_image = np.array([local_color_table[byt] if byt != exts[-1]['transparent_idx'] else (254, 0, 254) for byt in uncompressed])
File "/root/giftolottie/vendor/gif2numpy.py", line 629, in
np_image = np.array([local_color_table[byt] if byt != exts[-1]['transparent_idx'] else (254, 0, 254) for byt in uncompressed])
TypeError: 'ColorTable' object does not support indexing
root@loli:~/giftolottie# apt install colortable
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package colortable
root@loli:~/giftolottie#