laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
45.1k stars 4.91k forks source link

Sharing drawings from mobile destroys text positioning in SVG #10929

Open ImperialSquid opened 3 weeks ago

ImperialSquid commented 3 weeks ago

Operating system

Android

Joplin version

3.0.8

Desktop version info

Joplin 3.0.8 (prod, android)

Client ID: d94348b4ba434bb589db1fb87e33a45a Sync Version: 3 Profile Version: 47 Keychain Supported: No

AlertsPerfect: 1.0.1 Extra markdown editor settings: 1.1.1 History Panel: 1.0.2 Kanban: 1.1.0 Link Graph UI: 1.5.0 Math Mode: 0.6.2 Note Tabs: 1.4.0 Quick Links: 1.3.2

Android API level: 34 WebView version: 127.0.6533.103 WebView package: com.google.android.webview FTS enabled: 1 Hermes enabled: 1

Current behaviour

  1. Open a note
  2. Create a drawing
  3. Add multiple text elements on different positions
  4. Exit editing drawing
  5. Long press drawing
  6. Share to file storage
    • Tested on both local and cloud sharing with no difference

Example drawing within note: Screenshot_20240825_153950_Joplin

After sharing: Screenshot_20240825_154017_Drive

Expected behaviour

Text elements should be preserved when sharing

Logs

No response

personalizedrefrigerator commented 2 weeks ago

Thank you for reporting this!

I haven't been able to reproduce this on iOS (and my Android device's image viewer app doesn't seem to support SVGs). Perhaps the way the image editor positions text isn't supported by the system image viewer?

If you:

  1. Transfer the shared drawing to a desktop computer.
  2. Open the drawing in a web browser (Firefox, Chrome).

Does the text appear in the correct location?

ImperialSquid commented 2 weeks ago

Hmmm, good point, I thought that since I looked at the file through the google drive app's built-in image viewer and also through a gallery app's viewer that would confirm it was on the file, but having just looked at it on a desktop and having downloaded an svg viewer app where it works fine I guess that's not the case, weird... Guess it's an android issue not a joplin issue then...

personalizedrefrigerator commented 2 weeks ago

Currently, text objects are mostly positioned using style="transform: matrix(...)" rather than with x="..."/y="...". It could make sense to use style="transform: matrix(...)" only for rotation/scaling of text objects and x="..."/y="..." for positioning.

ImperialSquid commented 2 weeks ago

Yeah that's a good idea, it's not a massive issue I think, since I can still view the image on something else 🤷

If anything, I'd appreciate being able to export at different formats more, clearly not all svg viewers are created equal, but it's very hard to screw up showing a png correctly lol (I'm aware this is turning into an FR, just spitballing though)