Have you thought about compiling dcraw to javascript with emscripten? I'm not sure what the performance would be like, but I've seen this work in the past.
rawspeed won't let you extract the thumbnail. Also, the reason I suggested dcraw is because it's one C file and that makes things a lot easier, especially when compiling to javascript.
We tried it. It works with modification to emscripten and compiled code. Performance is acceptable and I think there is a much larger space using GPU to do the decoding as well. But I think the user won't just want to edit the thumbnail though I think many of them didn't know that.
>I think there is a much larger space using GPU to do the decoding as well.
I doubt that very much. Raw processing is very fast these days and I don't think you could make it faster with the GPU given the memory copying overhead. Look at darktable for an example of how the GPU is used intensively for the pipeline but the raw processing is all done by the CPU and is very fast.