zevlg / telega.el

GNU Emacs telegram client (unofficial)
https://zevlg.github.io/telega.el/
GNU General Public License v3.0
1.09k stars 85 forks source link

BUG: telega bugs out when in chat there are images or some other files type #467

Closed formula-spectre closed 3 months ago

formula-spectre commented 4 months ago

Telega Setup

OS: Gentoo Linux Emacs: GNU Emacs 29.3 (build 1, x86_64-gentoo-linux-musl, GTK+ Version 3.24.41, cairo version 1.18.0) Features: imagemagick svg webp ffmpeg Telega: telega v0.8.254 (TDLib v1.8.26-b41f321) (telega-server v0.8.2)

Current Behavior

whenever someone replies to an image, a bug appears. it seems also for audios? but I haven't investigated further, but I'm pretty sure it's for images

Steps to Reproduce

  1. chat with a friend, send them an image (C-c C-a RET photo RET)
  2. have them reply to that photo
  3. watch their non-response; their reponse gets replaced by a telega bug report.

as requested, here is the (truncated for privacy reasons): backtrace:

Debugger entered--Lisp error: (overflow-error)
  round(-0.0e+NaN)
  telega-svg-fit-into(0 0 2 1)
  telega-svg-embed-image-fitting((svg ((width . 2) (height . 1) (version . "1.1") (xmlns . "http://www.w3.org/2000/svg") (xmlns:xlink . "http://www.w3.org/1999/xlink")) (defs nil (clipPath ((id . "pclip")) (polygon ((points . "1 1, 1 1, 1 1, 1 0, 1 0, 1 0, 1 0, 1 0"))) (circle ((cx . 1) (cy . 1) (r . 0))) (circle ((cx . 1) (cy . 1) (r . 0))) (circle ((cx . 1) (cy . 0) (r . 0))) (circle ((cx . 1) (cy . 0) (r . 0)))))) "/tmp/chad_dorne.png" nil 0 0 :clip-path "url(#pclip)")
  telega-photo-preview--create-svg-one-line("/tmp/chad_dorne.png" nil 0 0)
  telega-photo-preview--create-image-one-line((:@type "photo" :has_stickers nil :minithumbnail (:@type "minithumbnail" :width 40 :height 18 :data "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACgcHiMeGSgjISMtKy...") :sizes [(:@type "photoSize" :type "m" :photo (:@type "file" :id 10332 :size 17757 :expected_size 17757 :local (:@type "localFile" :path "" :can_be_downloaded t :can_be_deleted nil :is_downloading_active nil :is_downloading_completed nil :download_offset 0 :downloaded_prefix_size 0 :downloaded_size 0) :remote (:@type "remoteFile" :id "AgACAgQAAxkDAAEDgCdmD7MsTci1VZfsPlQVOqkpLWI_SQACHc..." :unique_id "AQADHcExGz72gVBy" :is_uploading_active nil :is_uploading_completed t :uploaded_size 17757) :telega-file-recency 1712304940) :width 320 :height 142 :progressive_sizes []) (:@type "photoSize" :type "x" :photo (:@type "file" :id 10333 :size 24603 :expected_size 24603 :local (:@type "localFile" :path "" :can_be_downloaded t :can_be_deleted nil :is_downloading_active nil :is_downloading_completed nil :download_offset 0 :downloaded_prefix_size 0 :downloaded_size 0) :remote (:@type "remoteFile" :id "AgACAgQAAxkDAAEDgCdmD7MsTci1VZfsPlQVOqkpLWI_SQACHc..." :unique_id "AQADHcExGz72gVB9" :is_uploading_active nil :is_uploading_completed t :uploaded_size 24603) :telega-file-recency 1712304940) :width 402 :height 179 :progressive_sizes [1769 5587 11528 16206]) (:@type "photoSize" :type "i" :photo (:@type "file" :id 10334 :size 211705 :expected_size 211705 :local (:@type "localFile" :path "/tmp/chad_dorne.png" :can_be_downloaded nil :can_be_deleted nil :is_downloading_active nil :is_downloading_completed t :download_offset 0 :downloaded_prefix_size 211705 :downloaded_size 211705) :remote (:@type "remoteFile" :id "AgACAv7___8ZAwABA4AnZg-zLE3ItVWX7D5UFTqpKS1iP0kAAh..." :unique_id "AQADHcExGz72gVBu" :is_uploading_active nil :is_uploading_completed t :uploaded_size 211705) :telega-file-recency 1712304940) :width 0 :height 0 :progressive_sizes [])] :telega-image (image :type imagemagick :file "/tmp/chad_dorne.png" :height 3 :scale 1.0 :ascent center :margin (0 . 0) :telega-text "" :transform-smoothing t)) (:@type "chat" :id 817998332 :type (:@type "chatTypePrivate" :user_id 817998332) :title #("REDACTED" 0 2 (telega-emoji-p t telega-display "REDACTED")) :photo (:@type "chatPhotoInfo" :small (:@type "file" :id 1304 :size 8436 :expected_size 8436 :local (:@type "localFile" :path "/home/formula/.telega/profile_photos/3513276084578..." :can_be_downloaded t :can_be_deleted t :is_downloading_active nil :is_downloading_completed t :download_offset 0 :downloaded_prefix_size 8436 :downloaded_size 8436) :remote (:@type "remoteFile" :id "AQADBAADNKwxG_ypwTAACAIAA_ypwTAABPcBMC1WCQh5NAQ" :unique_id "AQADNKwxG_ypwTAAAQ" :is_uploading_active nil :is_uploading_completed t :uploaded_size 8436) :telega-file-recency 1712300406) :big (:@type "file" :id 1305 :size 0 :expected_size 0 :local (:@type "localFile" :path "" :can_be_downloaded t :can_be_deleted nil :is_downloading_active nil :is_downloading_completed nil :download_offset 0 :downloaded_prefix_size 0 :downloaded_size 0) :remote (:@type "remoteFile" :id "AQADBAADNKwxG_ypwTAACAMAA_ypwTAABPcBMC1WCQh5NAQ" :unique_id "AQADNKwxG_ypwTAB" :is_uploading_active nil :is_uploading_completed t :uploaded_size 0)) :minithumbnail (:@type "minithumbnail" :width 8 :height 8 :data "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACgcHiMeGSgjISMtKy...") :has_animation nil :is_personal nil) :accent_color_id 4 :background_custom_emoji_id "0" :profile_accent_color_id -1 :profile_background_custom_emoji_id "0" :permissions (:@type "chatPermissions" :can_send_basic_messages t :can_send_audios t :can_send_documents t :can_send_photos t :can_send_videos t :can_send_video_notes t :can_send_voice_notes t :can_send_polls t :can_send_other_messages t :can_add_web_page_previews t :can_change_info nil :can_invite_users nil :can_pin_messages t :can_create_topics nil) :positions [(:@type "chatPosition" :list (:@type "chatListFolder" :chat_folder_id 9) :order "7354299438975909946" :is_pinned nil) (:@type "chatPosition" :list (:@type "chatListMain") :order "7354299438975909946" :is_pinned nil)] :chat_lists [] :has_protected_content nil :is_translatable nil :is_marked_as_unread nil :view_as_topics nil :has_scheduled_messages nil :can_be_deleted_only_for_self t :can_be_deleted_for_all_users t :can_be_reported nil :default_disable_notification nil :unread_count 0 :last_read_inbox_message_id 240578985984 :last_read_outbox_message_id 240568500224 :unread_mention_count 0 ...))
[...]

let me know if someone else is needed!

formula-spectre commented 2 months ago

this bug persists; i've noticed this a lot with vocal messages