Firstly I don't expect this patch to be merged as is.
I'm developing a demosaic alogrithm and using FreeImage/LibRaw to unpack the raw data for me. Along with the metadata FreeImage currently provides it is useful to have access to some more, e.g. the black level. It is also useful to have some of this information (at least the Bayer pattern/whether it is X-Trans) before loading the full image.
Anonymous
Here's an updated patch that I'm using, again I don't expect it to be merged. I've edited the GNU Makefile to be able to build on macOS as for some reason the macOS one doesn't work for me.
Hi Samuel,
Can you provide the FreeImage modified files as files instead of a diff ?
As for LibRaw modified files, I cannot add them to the sources "as is" : you need to submit them to the LibRaw project manager.
If LibRaw is not modified the way you want, does your code still work ? In other words, do I need to wait for a LibRaw update in order to update FreeImage ?
Another point, you say
"I've edited the GNU Makefile to be able to build on macOS as for some reason the macOS one doesn't work for me"
Could you provide an updated Makefile.osx that I could add to the SVN ?
I must admit that macOS contributors are very very rare, so if your work can help other macOS users, a new Makefile.osx makefile would be great.
Hervé
Thanks Hervé,
Here's the PluginRAW.cpp file modified. This adds support for getting the metadata when loading with FIF_LOAD_NOPIXELS, plus additional for output size, frame offset, rotation/flip and aspect ratio (for rectangular pixels). It also lets one access the black level when loading with RAW_UNPROCESSED.
I've commented out the stuff that needs a LibRaw update. That adds support for getting the "fuji width" parameter, and the scale and outcam matrix.
Feel free to tell me it's a mess, it was done very quickly.
I'll have another look at the Makefile over the next day or two (though I can't promise much, I'm not overly familiar with macOS).
Edit: That also sets the output color space to ProPhoto, but probably not a good idea to set that for everyone :)
Last edit: Samuel Morris 2019-02-04
It seems that the issue I had with building was the similar to https://stackoverflow.com/questions/22922585/problems-linking-freeimage-3-16-0-using-make-and-clang-on-mac-os-x-10-8
It looks like manually running gensrclist.sh doesn't add that file either. Either manually adding the file or adding the define as in the stackoverflow answers fixes this.