Load images based on magic numbers instead of filename extension in C++
Currently, image loading in C++ relies only on the image extension and it is not possible to use the C++ interface to load images based on their magic numbers. While for python, this functionality was added by 28d836f2, there is still no way to do that in C++.
I could see a function called std::string bob::io::image::get_correct_image_extension(const std::string& image_name)
that returns the correct image extension (if possible) for a given image. It could use some implementation like this: http://stackoverflow.com/a/26350431 to determine the correct image type and return a corresponding extension.
Unfortunately, this would also need a (minor) modification of the C++ interface introduced by de4443bf that allows to optionally specify a different filename extension. Finally, we could replace the function introduced in 28d836f2 by the according C++ implementation.