pedrocr / rawloader

rust library to extract the raw data and some metadata from digital camera images
GNU Lesser General Public License v2.1
304 stars 53 forks source link

random tile decoding problems #47

Open hanatos opened 10 months ago

hanatos commented 10 months ago

heya,

i'm using rawloader through a thin c-bindings layer (which you can find here).

when running this code on a sequence of dng files, i get random tile decoding issues which manifest themselves like so:

2023-09-27-152613_1131x709_scrot

or so:

2023-09-27-153744_955x694_scrot

jumping around the images. looks like a threading issue to me (?). is this a bug? am i calling it wrong? do i have to wait before reading out the buffer after calling rawloader::decode_file()?

pedrocr commented 10 months ago

If it happens randomly on the same input threading seems like the most likely culprit.

A quick check would be to set RAYON_NUM_THREADS to 1 in the shell and see if that makes a difference.

There's nothing in the API that needs waiting, the threading is all internal. It may be some kind of bug in the environment rayon needs that the C binding is not setting up.