sticker-convert 2.11.2__tar.gz → 2.11.4__tar.gz

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.
Files changed (125) hide show
  1. {sticker_convert-2.11.2/src/sticker_convert.egg-info → sticker_convert-2.11.4}/PKG-INFO +2 -2
  2. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/requirements.txt +1 -1
  3. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/converter.py +9 -5
  4. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/downloaders/download_signal.py +12 -0
  5. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui.py +9 -6
  6. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/job.py +6 -1
  7. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/uploaders/upload_signal.py +62 -36
  8. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/version.py +1 -1
  9. {sticker_convert-2.11.2 → sticker_convert-2.11.4/src/sticker_convert.egg-info}/PKG-INFO +2 -2
  10. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert.egg-info/requires.txt +1 -1
  11. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/LICENSE +0 -0
  12. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/MANIFEST.in +0 -0
  13. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/README.md +0 -0
  14. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/pyproject.toml +0 -0
  15. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/setup.cfg +0 -0
  16. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/__init__.py +0 -0
  17. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/__main__.py +0 -0
  18. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/cli.py +0 -0
  19. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/definitions.py +0 -0
  20. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/downloaders/__init__.py +0 -0
  21. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/downloaders/download_base.py +0 -0
  22. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/downloaders/download_discord.py +0 -0
  23. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/downloaders/download_kakao.py +0 -0
  24. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/downloaders/download_line.py +0 -0
  25. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/downloaders/download_telegram.py +0 -0
  26. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/downloaders/download_viber.py +0 -0
  27. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/__init__.py +0 -0
  28. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/frames/__init__.py +0 -0
  29. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/frames/comp_frame.py +0 -0
  30. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/frames/config_frame.py +0 -0
  31. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/frames/control_frame.py +0 -0
  32. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/frames/cred_frame.py +0 -0
  33. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/frames/input_frame.py +0 -0
  34. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/frames/output_frame.py +0 -0
  35. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/frames/progress_frame.py +0 -0
  36. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/frames/right_clicker.py +0 -0
  37. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/gui_utils.py +0 -0
  38. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/windows/__init__.py +0 -0
  39. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/windows/advanced_compression_window.py +0 -0
  40. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/windows/base_window.py +0 -0
  41. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/windows/discord_get_auth_window.py +0 -0
  42. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/windows/kakao_get_auth_window.py +0 -0
  43. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/windows/line_get_auth_window.py +0 -0
  44. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/windows/signal_get_auth_window.py +0 -0
  45. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/gui_components/windows/viber_get_auth_window.py +0 -0
  46. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/.github/FUNDING.yml +0 -0
  47. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/.gitignore +0 -0
  48. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/README.md +0 -0
  49. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers/Info.plist +0 -0
  50. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Info.plist +0 -0
  51. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Contents.json +0 -0
  52. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Contents.json +0 -0
  53. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 1.sticker/Contents.json +0 -0
  54. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 1.sticker/Sticker 1.png +0 -0
  55. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 2.sticker/Contents.json +0 -0
  56. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 2.sticker/Sticker 2.png +0 -0
  57. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 3.sticker/Contents.json +0 -0
  58. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/Sticker Pack.stickerpack/Sticker 3.sticker/Sticker 3.png +0 -0
  59. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/App-Store-1024x1024pt.png +0 -0
  60. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Contents.json +0 -0
  61. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-App-Store-1024x768pt.png +0 -0
  62. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPad-67x50pt@2x.png +0 -0
  63. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPad-Pro-74x55pt@2x.png +0 -0
  64. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPhone-60x45pt@2x.png +0 -0
  65. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages-iPhone-60x45pt@3x.png +0 -0
  66. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages27x20pt@2x.png +0 -0
  67. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages27x20pt@3x.png +0 -0
  68. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages32x24pt@2x.png +0 -0
  69. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/Messages32x24pt@3x.png +0 -0
  70. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/iPad-Settings-29pt@2x.png +0 -0
  71. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/iPhone-Settings-29pt@3x.png +0 -0
  72. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers StickerPackExtension/Stickers.xcstickers/iMessage App Icon.stickersiconset/iPhone-settings-29pt@2x.png +0 -0
  73. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.pbxproj +0 -0
  74. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  75. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  76. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/project.xcworkspace/xcuserdata/niklaspeterson.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  77. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/ios-message-stickers-template/stickers.xcodeproj/xcuserdata/niklaspeterson.xcuserdatad/xcschemes/xcschememanagement.plist +0 -0
  78. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/job_option.py +0 -0
  79. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/NotoColorEmoji.ttf +0 -0
  80. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/appicon.icns +0 -0
  81. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/appicon.ico +0 -0
  82. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/appicon.png +0 -0
  83. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/compression.json +0 -0
  84. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/emoji.json +0 -0
  85. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/help.json +0 -0
  86. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/input.json +0 -0
  87. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/memdump_linux.sh +0 -0
  88. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/memdump_windows.ps1 +0 -0
  89. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/resources/output.json +0 -0
  90. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/uploaders/__init__.py +0 -0
  91. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/uploaders/compress_wastickers.py +0 -0
  92. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/uploaders/upload_base.py +0 -0
  93. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/uploaders/upload_telegram.py +0 -0
  94. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/uploaders/upload_viber.py +0 -0
  95. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/uploaders/xcode_imessage.py +0 -0
  96. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/auth/get_discord_auth.py +0 -0
  97. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/auth/get_kakao_auth.py +0 -0
  98. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/auth/get_kakao_desktop_auth.py +0 -0
  99. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/auth/get_line_auth.py +0 -0
  100. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/auth/get_signal_auth.py +0 -0
  101. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/auth/get_viber_auth.py +0 -0
  102. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/auth/telegram_api.py +0 -0
  103. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/auth/telethon_setup.py +0 -0
  104. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/callback.py +0 -0
  105. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/chrome_remotedebug.py +0 -0
  106. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/emoji.py +0 -0
  107. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/files/cache_store.py +0 -0
  108. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/files/json_manager.py +0 -0
  109. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/files/json_resources_loader.py +0 -0
  110. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/files/metadata_handler.py +0 -0
  111. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/files/run_bin.py +0 -0
  112. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/files/sanitize_filename.py +0 -0
  113. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/media/apple_png_normalize.py +0 -0
  114. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/media/codec_info.py +0 -0
  115. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/media/decrypt_kakao.py +0 -0
  116. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/media/format_verify.py +0 -0
  117. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/process.py +0 -0
  118. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert/utils/url_detect.py +0 -0
  119. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert.egg-info/SOURCES.txt +0 -0
  120. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert.egg-info/dependency_links.txt +0 -0
  121. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert.egg-info/entry_points.txt +0 -0
  122. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/src/sticker_convert.egg-info/top_level.txt +0 -0
  123. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/tests/test_compression.py +0 -0
  124. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/tests/test_download.py +0 -0
  125. {sticker_convert-2.11.2 → sticker_convert-2.11.4}/tests/test_export.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sticker-convert
3
- Version: 2.11.2
3
+ Version: 2.11.4
4
4
  Summary: Convert (animated) stickers to/from WhatsApp, Telegram, Signal, Line, Kakao, Viber, Discord, iMessage. Written in Python.
5
5
  Author-email: laggykiller <chaudominic2@gmail.com>
6
6
  Maintainer-email: laggykiller <chaudominic2@gmail.com>
@@ -379,7 +379,7 @@ Requires-Dist: numpy>=1.22.4
379
379
  Requires-Dist: Pillow~=11.1.0
380
380
  Requires-Dist: pyoxipng~=9.0.0
381
381
  Requires-Dist: python-telegram-bot~=21.10
382
- Requires-Dist: psutil~=6.1.1
382
+ Requires-Dist: psutil~=7.0.0
383
383
  Requires-Dist: PyMemoryEditor~=1.5.22
384
384
  Requires-Dist: requests~=2.32.3
385
385
  Requires-Dist: rlottie_python~=1.3.6
@@ -14,7 +14,7 @@ numpy>=1.22.4
14
14
  Pillow~=11.1.0
15
15
  pyoxipng~=9.0.0
16
16
  python-telegram-bot~=21.10
17
- psutil~=6.1.1
17
+ psutil~=7.0.0
18
18
  PyMemoryEditor~=1.5.22
19
19
  requests~=2.32.3
20
20
  rlottie_python~=1.3.6
@@ -284,10 +284,14 @@ class StickerConvert:
284
284
  return self.compress_fail()
285
285
 
286
286
  def check_if_compatible(self) -> Optional[bytes]:
287
+ f_fmt = self.opt_comp.get_format()
287
288
  if (
288
- FormatVerify.check_format(
289
+ # Issue #260: Some webp file not accepted by Whatsapp
290
+ ".webp" not in f_fmt[0]
291
+ and ".webp" not in f_fmt[1]
292
+ and FormatVerify.check_format(
289
293
  self.in_f,
290
- fmt=self.opt_comp.get_format(),
294
+ fmt=f_fmt,
291
295
  file_info=self.codec_info_orig,
292
296
  )
293
297
  and FormatVerify.check_file_res(
@@ -577,9 +581,9 @@ class StickerConvert:
577
581
  colors = colors[colors[:, 3] != 0]
578
582
  if colors.shape[0] != 0:
579
583
  alphas = colors[:, 3] / 255
580
- r_mean = np.mean(colors[:, 0] * alphas)
581
- g_mean = np.mean(colors[:, 1] * alphas)
582
- b_mean = np.mean(colors[:, 2] * alphas)
584
+ r_mean = cast(float, np.mean(colors[:, 0] * alphas))
585
+ g_mean = cast(float, np.mean(colors[:, 1] * alphas))
586
+ b_mean = cast(float, np.mean(colors[:, 2] * alphas))
583
587
  mean_total += (r_mean + g_mean + b_mean) / 3
584
588
 
585
589
  if mean_total / len(self.frames_raw) < 128:
@@ -58,6 +58,18 @@ class DownloadSignal(DownloadBase):
58
58
 
59
59
  self.cb.put("update_bar")
60
60
 
61
+ if pack.cover is not None and pack.cover.image_data is not None:
62
+ cover_path = Path(self.out_dir, "cover")
63
+ with open(cover_path, "wb") as f:
64
+ f.write(pack.cover.image_data)
65
+
66
+ cover_codec = CodecInfo.get_file_codec(cover_path)
67
+ if cover_codec == "":
68
+ cover_codec = "png"
69
+ cover_path_new = Path(self.out_dir, f"cover.{cover_codec}")
70
+ cover_path.rename(cover_path_new)
71
+ self.cb.put(f"Downloaded cover.{cover_codec}")
72
+
61
73
  MetadataHandler.set_metadata(
62
74
  self.out_dir, title=pack.title, author=pack.author, emoji_dict=emoji_dict
63
75
  )
@@ -634,7 +634,7 @@ class GUI(Window):
634
634
  initialvalue: Optional[str] = None,
635
635
  cli_show_initialvalue: bool = True,
636
636
  parent: Optional[object] = None,
637
- ) -> Any:
637
+ ) -> str:
638
638
  self.action = partial(
639
639
  Querybox.get_string, # type: ignore
640
640
  question,
@@ -646,7 +646,12 @@ class GUI(Window):
646
646
  self.response_event.wait()
647
647
  self.response_event.clear()
648
648
 
649
- return self.response
649
+ if self.response is None:
650
+ return ""
651
+ elif isinstance(self.response, str):
652
+ return self.response
653
+ else:
654
+ raise RuntimeError(f"Invalid response in cb_ask_str: {self.response}")
650
655
 
651
656
  def cb_ask_bool(
652
657
  self, question: str, parent: Union[Window, Toplevel, None] = None
@@ -701,9 +706,9 @@ class GUI(Window):
701
706
  set_progress_mode, steps, update_bar, *args, **kwargs
702
707
  )
703
708
 
704
- def highlight_fields(self) -> bool:
709
+ def highlight_fields(self):
705
710
  if not self.init_done:
706
- return True
711
+ return
707
712
 
708
713
  input_option = self.get_input_name()
709
714
  input_option_display = self.get_input_display_name()
@@ -853,5 +858,3 @@ class GUI(Window):
853
858
  else:
854
859
  self.comp_frame.comp_preset_opt.config(bootstyle="secondary") # type: ignore
855
860
  self.output_frame.output_option_opt.config(bootstyle="secondary") # type: ignore
856
-
857
- return True
@@ -642,7 +642,12 @@ class Job:
642
642
 
643
643
  if not in_f.is_file():
644
644
  continue
645
- if CodecInfo.get_file_ext(i) in (".txt", ".m4a") or Path(i).stem == "cover":
645
+ if (
646
+ CodecInfo.get_file_ext(i) in (".txt", ".m4a")
647
+ or (
648
+ self.opt_comp.preset != "signal" and Path(i).stem == "cover"
649
+ ) # Signal cover has same spec as normal sticker
650
+ ):
646
651
  shutil.copy(in_f, output_dir / i.name)
647
652
  else:
648
653
  in_fs.append(i)
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  import copy
3
3
  from pathlib import Path
4
- from typing import Any, Dict, List, Tuple
4
+ from typing import Any, Dict, List, Optional, Tuple
5
5
 
6
6
  import anyio
7
7
  from signalstickers_client.errors import SignalException
@@ -46,51 +46,77 @@ class UploadSignal(UploadBase):
46
46
  )
47
47
  return result
48
48
 
49
- def add_stickers_to_pack(
50
- self, pack: LocalStickerPack, stickers: List[Path], emoji_dict: Dict[str, str]
51
- ) -> None:
52
- for src in stickers:
53
- self.cb.put(f"Verifying {src} for uploading to signal")
49
+ def create_sticker(
50
+ self, src: Path, emoji_dict: Dict[str, str]
51
+ ) -> Optional[Sticker]:
52
+ self.cb.put(f"Verifying {src} for uploading to signal")
54
53
 
55
- sticker = Sticker()
56
- sticker.id = pack.nb_stickers
54
+ sticker = Sticker()
57
55
 
58
- emoji = extract_emojis(emoji_dict.get(Path(src).stem, ""))
59
- if emoji == "":
60
- self.cb.put(
61
- f"Warning: Cannot find emoji for file {Path(src).name}, using default emoji..."
62
- )
63
- emoji = self.opt_comp.default_emoji
64
- sticker.emoji = emoji[:1]
56
+ emoji = extract_emojis(emoji_dict.get(Path(src).stem, ""))
57
+ if emoji == "":
58
+ self.cb.put(
59
+ f"Warning: Cannot find emoji for file {Path(src).name}, using default emoji..."
60
+ )
61
+ emoji = self.opt_comp.default_emoji
62
+ sticker.emoji = emoji
65
63
 
66
- if Path(src).suffix == ".webp":
67
- spec_choice = self.webp_spec
64
+ if Path(src).suffix == ".webp":
65
+ spec_choice = self.webp_spec
66
+ else:
67
+ spec_choice = self.png_spec
68
+
69
+ if not FormatVerify.check_file(src, spec=spec_choice):
70
+ if self.opt_comp.fake_vid or CodecInfo.is_anim(src):
71
+ dst = "bytes.apng"
68
72
  else:
69
- spec_choice = self.png_spec
70
-
71
- if not FormatVerify.check_file(src, spec=spec_choice):
72
- if self.opt_comp.fake_vid or CodecInfo.is_anim(src):
73
- dst = "bytes.apng"
74
- else:
75
- dst = "bytes.png"
76
- success, _, image_data, _ = StickerConvert.convert(
77
- Path(src), Path(dst), self.opt_comp_merged, self.cb, self.cb_return
73
+ dst = "bytes.png"
74
+ success, _, image_data, _ = StickerConvert.convert(
75
+ Path(src), Path(dst), self.opt_comp_merged, self.cb, self.cb_return
76
+ )
77
+ if not success:
78
+ self.cb.put(
79
+ f"Warning: Cannot compress file {Path(src).name}, skip uploading this file..."
78
80
  )
79
- if not success:
80
- self.cb.put(
81
- f"Warning: Cannot compress file {Path(src).name}, skip uploading this file..."
82
- )
83
- continue
81
+ return None
84
82
 
85
- assert isinstance(image_data, bytes)
83
+ assert isinstance(image_data, bytes)
86
84
 
87
- sticker.image_data = image_data
88
- else:
89
- with open(src, "rb") as f:
90
- sticker.image_data = f.read()
85
+ sticker.image_data = image_data
86
+ else:
87
+ with open(src, "rb") as f:
88
+ sticker.image_data = f.read()
89
+
90
+ return sticker
91
91
 
92
+ def add_stickers_to_pack(
93
+ self, pack: LocalStickerPack, stickers: List[Path], emoji_dict: Dict[str, str]
94
+ ) -> None:
95
+ cover_file = MetadataHandler.get_cover(self.opt_output.dir)
96
+ cover_file_bytes = None
97
+ if cover_file:
98
+ with open(cover_file, "rb") as f:
99
+ cover_file_bytes = f.read()
100
+ for src in stickers:
101
+ sticker = self.create_sticker(src, emoji_dict)
102
+ if sticker is None:
103
+ continue
104
+ sticker.id = pack.nb_stickers
92
105
  pack._addsticker(sticker) # type: ignore
93
106
 
107
+ if (
108
+ cover_file
109
+ and pack.cover is None
110
+ and sticker.image_data == cover_file_bytes
111
+ ):
112
+ pack.cover = sticker
113
+
114
+ if cover_file and pack.cover is None:
115
+ sticker = self.create_sticker(cover_file, emoji_dict)
116
+ if sticker is not None:
117
+ sticker.id = pack.nb_stickers
118
+ pack.cover = sticker
119
+
94
120
  def upload_stickers_signal(self) -> Tuple[int, int, List[str]]:
95
121
  urls: List[str] = []
96
122
 
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
- __version__ = "2.11.2"
3
+ __version__ = "2.11.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sticker-convert
3
- Version: 2.11.2
3
+ Version: 2.11.4
4
4
  Summary: Convert (animated) stickers to/from WhatsApp, Telegram, Signal, Line, Kakao, Viber, Discord, iMessage. Written in Python.
5
5
  Author-email: laggykiller <chaudominic2@gmail.com>
6
6
  Maintainer-email: laggykiller <chaudominic2@gmail.com>
@@ -379,7 +379,7 @@ Requires-Dist: numpy>=1.22.4
379
379
  Requires-Dist: Pillow~=11.1.0
380
380
  Requires-Dist: pyoxipng~=9.0.0
381
381
  Requires-Dist: python-telegram-bot~=21.10
382
- Requires-Dist: psutil~=6.1.1
382
+ Requires-Dist: psutil~=7.0.0
383
383
  Requires-Dist: PyMemoryEditor~=1.5.22
384
384
  Requires-Dist: requests~=2.32.3
385
385
  Requires-Dist: rlottie_python~=1.3.6
@@ -14,7 +14,7 @@ numpy>=1.22.4
14
14
  Pillow~=11.1.0
15
15
  pyoxipng~=9.0.0
16
16
  python-telegram-bot~=21.10
17
- psutil~=6.1.1
17
+ psutil~=7.0.0
18
18
  PyMemoryEditor~=1.5.22
19
19
  requests~=2.32.3
20
20
  rlottie_python~=1.3.6