woelper / oculante

A fast and simple image viewer / editor for many operating systems
https://github.com/woelper/oculante
MIT License
870 stars 40 forks source link

Can't open files through file manager: oculante doesn't parse urls #399

Open RuniTails opened 1 month ago

RuniTails commented 1 month ago

Hi!

When I try to open image in the file manager, oculante responds with Failed to load file:///home/the_witch/Pictures/test%20image.jpg

Both test runs used the same image and the same unmodified, manually compiled latest sources

Test run 1 (using path, image opened like i expected): test_run_1.txt Important part:

[2024-07-10T16:22:24Z DEBUG oculante] Image is: ["/home/the_witch/Pictures/test image.jpg"]
[2024-07-10T16:22:24Z DEBUG oculante::utils] Stopping player on load
[2024-07-10T16:22:24Z DEBUG oculante::utils] Image not in cache.
[2024-07-10T16:22:24Z DEBUG oculante::image_loader] Detected as "Joint Photographic Experts Group" jpg
[2024-07-10T16:22:24Z DEBUG oculante::image_loader] matching 'jpg'
[2024-07-10T16:22:24Z DEBUG oculante::image_loader] Loading jpeg using turbojpeg
[2024-07-10T16:22:24Z DEBUG oculante::utils] Got a frame receiver from opening image
[2024-07-10T16:22:24Z DEBUG oculante::utils] Received image in 3.429783ms

Test run 2 (using url, image failed to load): test_run_2.txt Important part:

[2024-07-10T16:22:10Z DEBUG oculante] Image is: ["file:///home/the_witch/Pictures/test%20image.jpg"]
[2024-07-10T16:22:10Z DEBUG oculante::utils] Stopping player on load
[2024-07-10T16:22:10Z DEBUG oculante::utils] Image not in cache.
[2024-07-10T16:22:10Z ERROR oculante::image_loader] Can't determine image type
[2024-07-10T16:22:10Z DEBUG oculante::image_loader] matching 'jpg'
[2024-07-10T16:22:10Z DEBUG oculante::image_loader] Loading jpeg using turbojpeg
[2024-07-10T16:22:10Z ERROR oculante::utils] No such file or directory (os error 2)
[2024-07-10T16:22:10Z DEBUG oculante] Received message: LoadError("No such file or directory (os error 2)")
[2024-07-10T16:22:10Z DEBUG oculante] Received message: LoadError("Failed to load file:///home/the_witch/Pictures/test%20image.jpg")

Changing desktop file to use %F instead of %U seems to fix the problem without resorting to parsing the urls https://github.com/woelper/oculante/blob/0ff5d53bd0592538ea73387553cddbfebc6777cc/res/oculante.desktop#L6

woelper commented 1 month ago

Yes, this is a known issue. It is definitely something I plan on doing in the future. Thanks!