Niepce December 2022 updates

Happy new year !

Here is some udpdate on Niepce work done in December 2022. Mostly changes under the hood, but important ones to move forward with improving the features. The short version: it feels great to remove C++ code.

Build system

I have now switched the build system from autotools to meson. It's faster, and is more lenient when I forget to pass -j to build on my 12 core workstation: it does it by itself.

This was work I had around to finish as I mentionned in the November update.

I will remove the autotools files in the future.

Drag and drop, and albums

This is the only visible (new feature or UI) change this cycle.

Implemented drag and drop between the grid view and strip view to the workspace. You can now add images to an album that way. Also albums can be created, renamed, deleted, using the contextual menu on the workspace.

This closed issue 40.

Importer

One of my big todo list item is to finish the import. But when testing it, I fell into crashes that I believe are related to the multithreading nature of the feature. So I decided it was time to actually port the whole import machinery to Rust as I still have to "finish" it.

There are currently two importers: directories and camera. The latter uses gphoto2 to download from the camera, and is the more complex of the two.

For starter it seemed to be logical to port the gphoto layer for the import. The Rust gphoto2-rs bindings are a good candidate. I was using the direct C API and these bindings provide a bit of a higher level API. I ended up having to fix two things: the missing GP_ERROR_IO_USB_CLAIM error (merged) and the not being able to download the thumbnails. The former is important because GVFS tries to want to monopolise the camera, and that the error you get. The other is need to download the previews so they can be show in the UI.

Testing this with my now defective1 Canon G7X MkII leads to interesting issues, like 0 bytes files left over in case of error, as the device disappear from the bus. I wrote some cleanup code. Further down the read I need to make this more robust, possibly recovering from the error, and being able to import by finding "duplicates" so that in the case of failure, if we import again, it excludes already imported images.

Other issues

Testing the imported code, I found that some RAW files where ignored. One is mime_guess didn't know about RAW file (PR submitted), the other is, by rethinking the logic, to add the list of extension to the libopenraw-rs API (it's in the C API) so that I can prioritize them. Released versiom 0.1.2 of the latter. And while I'm at it, released libopenraw 0.3.3, but this was unrelated.

I'm sure I'll run into more problems, but here the goal is to have a self contained detection.

Moving forward

This code is still used from C++, until I land the upcoming changes of rewriting the importer in Rust.2

After that, the import flow can be improved: automatic folder creation, metadata presets, deduplicating (I keep importing the same pictures over and over).

Thank you for reading.

1

It has problems getting into "I can take pictures" mood. Not sure I can repair it. Still a CAD$900 camera.

2

Changes actually are ready to be pushed.