Problem
When syncing images from Telegram to Obsidian using the Telegram Sync plugin, image files are being saved with an incorrect extension: .jpg_ instead of .jpg. This causes Obsidian to fail to find and display embedded images.
Expected Behavior
- Image files from Telegram should be saved with the correct extension (
.jpg, .png, etc.)
- Obsidian should be able to display images using the wikilink format:
![[photos/photo_name.jpg]]
- Images should display automatically in notes without manual file renaming
Actual Behavior
- Image files are saved as
photo_229642654_263-20251127193540.jpg_ (with underscore after extension)
- When the bot creates notes with embedded image links like
![[photos/photo_229642654_263-20251127193540.jpg]], Obsidian cannot find the file
- Error message in Obsidian:
"photos/photo_229642654_263-20251127193540.jpg" cannot be found
- Images only display after manually renaming the file to remove the trailing underscore
Steps to Reproduce
- Configure Telegram Sync with File path template:
Telegram-лента/photos/{{file:name}} - {{messageTime:YYYYMMDDHHmmssSSS}}.{{file:extension}}
- Send JPG image from Telegram to the bot
- Check the created file in Obsidian vault
- Observe that file extension is
.jpg_ instead of .jpg
- Try to view the image using embedded wikilink in the note
- Image fails to display because file cannot be found
Workaround
Files display correctly after manually removing the trailing underscore from the file extension (.jpg_ → .jpg). After renaming, Obsidian automatically updates the links and displays the images correctly.
Related Issue
This appears to be related to issue #344 "Images saved in the database with the .file extension instead of jpg" - same root cause (incorrect extension formatting) but different symptom (underscore suffix instead of .file extension).
Additional Context
- The template successfully creates both files and links with mostly correct format
- The file extension generation adds an unexpected underscore character at the end
- This breaks the file reference between the wikilink in the note and the actual filename in the photos folder
- The issue affects all image types (jpg, png, mp4, etc.)
Problem
When syncing images from Telegram to Obsidian using the Telegram Sync plugin, image files are being saved with an incorrect extension:
.jpg_instead of.jpg. This causes Obsidian to fail to find and display embedded images.Expected Behavior
.jpg,.png, etc.)![[photos/photo_name.jpg]]Actual Behavior
photo_229642654_263-20251127193540.jpg_(with underscore after extension)![[photos/photo_229642654_263-20251127193540.jpg]], Obsidian cannot find the file"photos/photo_229642654_263-20251127193540.jpg" cannot be foundSteps to Reproduce
Telegram-лента/photos/{{file:name}} - {{messageTime:YYYYMMDDHHmmssSSS}}.{{file:extension}}.jpg_instead of.jpgWorkaround
Files display correctly after manually removing the trailing underscore from the file extension (
.jpg_→.jpg). After renaming, Obsidian automatically updates the links and displays the images correctly.Related Issue
This appears to be related to issue #344 "Images saved in the database with the .file extension instead of jpg" - same root cause (incorrect extension formatting) but different symptom (underscore suffix instead of .file extension).
Additional Context