giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.29k stars 457 forks source link

Where do the IMGs in .ctb or .ctd file? #2520

Open lamborghinipth opened 1 month ago

lamborghinipth commented 1 month ago

Version, Operative system State the Version and the Operative System/Desktop. Try the latest available version before reporting an issue: Windows 11

Describe the bug A clear and concise description of what the bug is. I cannot access https://giuspen.net/cherrytreemanual/ to read User Manual so I do not know what file extension .ctb or .ctd is. But I know CherryTree only allow insert/ save local image (no preview embed image from Internet link)

To Reproduce If applicable, attach a non-personal document where the issue can be reproduced systematically. Steps to reproduce the behavior:

  1. On Browser, go to any page on the Internet that contain images. Right click on any image and choose Copy image from Context menu
  2. On CherryTree, open new node and Ctrl + C to paste image from clipboard '....'
  3. Save CherryTree file (Ctrl + S) '....'
  4. See issue. File size of .ctb or .ctd increased but there's no folder for saved image

Screenshots If applicable, add screenshots to help explain your problem: NO NEED

giuspen commented 1 month ago

In a .ctd file, which is an xml, the images are stored after being converted to base64 representation of the binary file Example: <encoded_png char_offset="61" justification="left">iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCA .... 7+DBfu4LqLwAAAAASUVORK5CYII=</encoded_png>

In a .ctb file, which is a sqlite file, the binary blob of the file is stored in the table with the name 'image', column name 'png'

If you are looking for a storage type where the images are saved as independent files, look for the new multifile storage type / save as - multiple files in hierarchical folder structure