sticker-convert 2.1.10__py3-none-any.whl → 2.1.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env python3
2
2
  '''sticker-convert'''
3
- __version__ = '2.1.10'
3
+ __version__ = '2.1.11'
@@ -6,7 +6,7 @@ from typing import Optional
6
6
 
7
7
  import imageio.v3 as iio
8
8
  from rlottie_python import LottieAnimation # type: ignore
9
- from PIL import Image
9
+ from PIL import Image, UnidentifiedImageError
10
10
  import mmap
11
11
 
12
12
 
@@ -69,16 +69,19 @@ class CodecInfo:
69
69
 
70
70
  @staticmethod
71
71
  def get_file_codec(file: str) -> Optional[str]:
72
- file_ext = CodecInfo.get_file_ext(file)
73
-
74
- if file_ext == ".webp":
75
- plugin = "pillow"
72
+ codec = None
73
+ try:
74
+ codec = Image.open(file).format
75
+ except UnidentifiedImageError:
76
+ pass
77
+
78
+ # Unable to distinguish apng and png
79
+ if codec not in (None, 'PNG'):
80
+ return codec.lower()
76
81
  else:
77
- plugin = "pyav"
78
- metadata = iio.immeta(file, plugin=plugin, exclude_applied=False)
79
- codec = metadata.get("codec", None)
80
-
81
- return codec
82
+ metadata = iio.immeta(file, plugin="pyav", exclude_applied=False)
83
+ codec = metadata.get("codec", None)
84
+ return codec
82
85
 
83
86
  @staticmethod
84
87
  def get_file_res(file: str) -> tuple[int, int]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sticker-convert
3
- Version: 2.1.10
3
+ Version: 2.1.11
4
4
  Summary: Convert (animated) stickers to/from WhatsApp, Telegram, Signal, Line, Kakao, iMessage. Written in Python.
5
5
  Author-email: laggykiller <chaudominic2@gmail.com>
6
6
  Maintainer-email: laggykiller <chaudominic2@gmail.com>
@@ -1,4 +1,4 @@
1
- sticker_convert/__init__.py,sha256=XnW22HrWTuHBoQHjSjhC963Fsmv7IBcTmZV-X2yMVm0,67
1
+ sticker_convert/__init__.py,sha256=jfcI-Nq9bhNcUPfJL46bHZg9Jg_mwzMqiiiJ-hgtz_4,67
2
2
  sticker_convert/__main__.py,sha256=W3n9SprqoDQxaWDAqLVA7DiavMdbPLVdtbASTKSpZS0,546
3
3
  sticker_convert/cli.py,sha256=21D5lAghcB3f5V7vk_qS6Di-NtGlH1ilAqDCPpzVUak,16534
4
4
  sticker_convert/converter.py,sha256=k4wy8nYtUFaEFxQ6QRPWPUyAorGgRIWQ0WLElsnKTXw,16780
@@ -81,12 +81,12 @@ sticker_convert/utils/files/json_manager.py,sha256=BBndjSY5kvjxurOpnDI2DRsKoLrNB
81
81
  sticker_convert/utils/files/metadata_handler.py,sha256=KIy8j89DMBW7-gpL9jqhzz96GgBvPHsRYegHXemk_mY,8346
82
82
  sticker_convert/utils/files/run_bin.py,sha256=4c8y5c_2wUfm0hbJSOGFcezpW5BVqM5_e9aliPbxvwo,1632
83
83
  sticker_convert/utils/media/apple_png_normalize.py,sha256=YGrZ8pZvgfhw8dW-0gf7XcXk_R82lJTX-oTo6SsB7uY,3719
84
- sticker_convert/utils/media/codec_info.py,sha256=GEfpA3OPNfB9pnsj6sFeVGFBJ34_etkmEAWaTXcnoJ4,4265
84
+ sticker_convert/utils/media/codec_info.py,sha256=zX9zXUy0qxxxvJIJMF7KBUm4seOeJN-ZFcJE2yqsuOs,4421
85
85
  sticker_convert/utils/media/decrypt_kakao.py,sha256=gMz64vIGEIPAl4FFWuUbPMHE7vExr46ZFpzMoukvwws,1918
86
86
  sticker_convert/utils/media/format_verify.py,sha256=7WvvDSFDkyG1WlkXKqVbmPjKiyEedtqivZcCqSNziD8,6179
87
- sticker_convert-2.1.10.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
88
- sticker_convert-2.1.10.dist-info/METADATA,sha256=4uzGsNFVraQS0WDuqS7Afl6Vduu67EHFR3qf6hnmmm0,44697
89
- sticker_convert-2.1.10.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
90
- sticker_convert-2.1.10.dist-info/entry_points.txt,sha256=MNJ7XyC--ugxi5jS1nzjDLGnxCyLuaGdsVLnJhDHCqs,66
91
- sticker_convert-2.1.10.dist-info/top_level.txt,sha256=r9vfnB0l1ZnH5pTH5RvkobnK3Ow9m0RsncaOMAtiAtk,16
92
- sticker_convert-2.1.10.dist-info/RECORD,,
87
+ sticker_convert-2.1.11.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
88
+ sticker_convert-2.1.11.dist-info/METADATA,sha256=NSKhAwvKvr9esES64SYlWCtb7nPeh3IJ96sf2udkcjk,44697
89
+ sticker_convert-2.1.11.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
90
+ sticker_convert-2.1.11.dist-info/entry_points.txt,sha256=MNJ7XyC--ugxi5jS1nzjDLGnxCyLuaGdsVLnJhDHCqs,66
91
+ sticker_convert-2.1.11.dist-info/top_level.txt,sha256=r9vfnB0l1ZnH5pTH5RvkobnK3Ow9m0RsncaOMAtiAtk,16
92
+ sticker_convert-2.1.11.dist-info/RECORD,,