laurent22 / joplin

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

.svgz images aren't displayed #8663

Open personalizedrefrigerator opened 1 year ago

personalizedrefrigerator commented 1 year ago

Environment

Joplin version: 2.11, 5d87b4ca3e3fcae6fa96b080d24e80f8f691edbc Platform: Android, desktop, edit: and iOS OS specifics: Android 14 emulator, Ubuntu 23.04

Steps to reproduce

  1. GZip an SVG image and rename it to svgz
  2. Attach the SVG image to a note as an image.

Describe what you expected to happen

The SVGZ image should be displayed.

Screenshot

Joplin note in markdown editor mode. An SVGZ file is attached and not displaying.

See also

laurent22 commented 1 year ago

There's a recent commit to add support for the AVIF format, so it can probably be implemented using the same pattern. I assume that it's supported by Electron?

personalizedrefrigerator commented 1 year ago

It looks like svgz is already in mime-utils-types.js. At least for Chrome, it looks like SVGZ images need a Content-Encoding: gzip header when served.

personalizedrefrigerator commented 1 year ago

One approach would be to manually decompress .svgz images, but that's a large amount of extra code to support this format.

An alternative might be to internally compress all image/svg+xml images (and perhaps some other types of attachments).

Edit/note: Renaming .svgz images to .svg does not fix the issue.

github-actions[bot] commented 1 year ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

personalizedrefrigerator commented 1 year ago

Still an issue.