Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakage and low performance while viewing RAW files #742

Open
luther09 opened this issue Feb 15, 2025 · 2 comments
Open

Breakage and low performance while viewing RAW files #742

luther09 opened this issue Feb 15, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@luther09
Copy link

luther09 commented Feb 15, 2025

Environment:

  • OS: Windows 10
  • qView version: 6.1

Information:

In the file below there are 10 images in .cr2 format. Open one of them and try to move forward with the keyboard right arrow key. The application takes too long to show the next image.

https://1drv.ms/u/c/d3ebeefc2aca61e6/EfhX2HRr9ohJn_Z9P-Uj45IBgSjyU0aLpNzKRFgjz2tIFQ?e=by68Sm

If you keep pressing the right arrow key on the keyboard, the image is distorted and will not be displayed.

Screenshot

Image

Screenshot

Image

Sometimes it shows a blank black screen.

Screenshot

Image


I cannot reproduce this behavior in an image folder containing multiple jpg, png.
I have also tested these files by opening them with another open source image viewer and found no problems, so the problem is qView-specific.

@luther09 luther09 added the bug Something isn't working label Feb 15, 2025
@luther09 luther09 changed the title Corruption and poor performance when viewing RAW files Breakage and low performance while viewing RAW files Feb 15, 2025
@jdpurcell
Copy link
Contributor

I can reproduce the corrupt-looking image thing but only reliably on one of the 3 test environments I tried. I believe it's related to the "Preloading" feature somehow, since the problem went away with preloading disabled.

As for performance, the decoder we're using accepts a quality parameter, and when I tried it (e.g. imageReader.setQuality(10);) it helped a bit, but it was still pretty slow (quality 10 took about 3/4 the time vs default quality).

@jdpurcell
Copy link
Contributor

jdpurcell commented Feb 16, 2025

@jurplel Per LibRaw docs, there are thread-safe and single-threaded variants of the library. When we build via vcpkg, both are available:

libraw provides CMake targets:

    find_package(libraw CONFIG REQUIRED)
    # non-thread-safe
    target_link_libraries(main PRIVATE libraw::raw)
    # thread-safe
    target_link_libraries(main PRIVATE libraw::raw_r)

I believe we're linking against the single-threaded version. Do you know what controls that? I see FindLibRaw.cmake has some code mentioning both variants, but then I don't know if or how it's supposed to choose between the two, or if the last ~20 lines are basically forcing it to link to the single-threaded version. EDIT: I figured out how to use the thread-safe version; I'll submit a pull request soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants