bob.io.image issueshttps://gitlab.idiap.ch/bob/bob.io.image/-/issues2017-10-26T00:54:05Zhttps://gitlab.idiap.ch/bob/bob.io.image/-/issues/27Non-templated functions implemented in header files need to be inlined2017-10-26T00:54:05ZManuel Günthersiebenkopf@googlemail.comNon-templated functions implemented in header files need to be inlinedWhen including `<bob.io.image/image.h>` in two C++ files, and linking these together, I obtain the linker error:
```
file_a.o: In function `X':
file_a.cpp:(.text+0x7d0): multiple definition of `bob::io::image::write_color_image(blit...When including `<bob.io.image/image.h>` in two C++ files, and linking these together, I obtain the linker error:
```
file_a.o: In function `X':
file_a.cpp:(.text+0x7d0): multiple definition of `bob::io::image::write_color_image(blitz::Array<unsigned char, 3> const&, std::string const&, std::string)'
file_b.cpp:(.text+0x880): first defined here
file_a.cpp.o: In function `X':
file_a.cpp:(.text+0xc40): multiple definition of `bob::io::image::write_gray_image(blitz::Array<unsigned char, 2> const&, std::string const&, std::string)'
file_b.cpp.o:image_bbx_data_layer.cpp:(.text+0xcf0): first defined here
file_a.cpp.o: In function `X':
file_a.cpp:(.text+0x26c0): multiple definition of `bob::io::image::read_gray_image(std::string const&, std::string)'
file_b.o:image_bbx_data_layer.cpp:(.text+0x17c0): first defined here
```
This can be solved by declaring the according functions `inline`.Manuel Günthersiebenkopf@googlemail.comManuel Günthersiebenkopf@googlemail.comhttps://gitlab.idiap.ch/bob/bob.io.image/-/issues/23C++ test inside main.cpp2017-10-26T00:54:05ZManuel Günthersiebenkopf@googlemail.comC++ test inside main.cppCurrently, I have implemented some test cases in C++ and have bound them inside the ``main.cpp``. This means that these test cases are always loaded with the main module. It would be better to have these inside a separate file, e.g., ``t...Currently, I have implemented some test cases in C++ and have bound them inside the ``main.cpp``. This means that these test cases are always loaded with the main module. It would be better to have these inside a separate file, e.g., ``test.cpp`` -- similar to what is done in ``bob.io.base``: https://gitlab.idiap.ch/bob/bob.io.base/blob/master/bob/io/base/test.cpp
and load the test cases only in the test module, like:
https://gitlab.idiap.ch/bob/bob.io.base/blob/master/bob/io/base/test_cpp.py#L1Manuel Günthersiebenkopf@googlemail.comManuel Günthersiebenkopf@googlemail.comhttps://gitlab.idiap.ch/bob/bob.io.image/-/issues/20Unknown ``GifErrorString``2017-10-26T00:54:05ZManuel Günthersiebenkopf@googlemail.comUnknown ``GifErrorString``The function ``GifErrorString`` is only available in giflib version 5, as discussed here: http://lists.openimageio.org/pipermail/oiio-dev-openimageio.org/2013-October/006315.html
On my machine (with giflib version 4.1.6-11) I get the ...The function ``GifErrorString`` is only available in giflib version 5, as discussed here: http://lists.openimageio.org/pipermail/oiio-dev-openimageio.org/2013-October/006315.html
On my machine (with giflib version 4.1.6-11) I get the compilation error:
```
bob.io.image/bob/io/image/cpp/gif.cpp: In function ‘void GifErrorHandler(const char*, int)’:
bob.io.image/bob/io/image/cpp/gif.cpp:284:50: error: ‘GifErrorString’ was not declared in this scope
const char* error_string = GifErrorString(error);
```
@andre.anjos Could you please fix that ASAP? The master branch is not compiling on my machine any more.André AnjosAndré Anjoshttps://gitlab.idiap.ch/bob/bob.io.image/-/issues/19Cannot read CMYK jpeg images2018-08-25T17:47:39ZManuel Günthersiebenkopf@googlemail.comCannot read CMYK jpeg imagesCurrently, we support only images in either gray or RGB color space. However, there are some JPEG images stored in different color spaces, such as CMYK or YCCK: https://www.freedesktop.org/wiki/Software/libjpeg
Currently these images ca...Currently, we support only images in either gray or RGB color space. However, there are some JPEG images stored in different color spaces, such as CMYK or YCCK: https://www.freedesktop.org/wiki/Software/libjpeg
Currently these images cannot be read with ``bob.io.image.load``, we get the following exception:
```
RuntimeError: File - CMYK.jpg: C++ exception caught: 'unsupported number of planes (4) when reading file. Image depth must be 1 or 3.'
```
Unfortunately, ``libjpeg`` does not provide a default color conversion to convert CMYK images into RGB (only YCCK <==> CMYK conversions are supported). Hence, in order to be able to read these types of images, we need to perform our own color conversion, i.e., here: https://gitlab.idiap.ch/bob/bob.io.image/blob/master/bob/io/image/cpp/jpeg.cpp#L152
Ideally, we would have a link to ``bob.ip.color`` and implement the color conversion function (see e.g. here: http://www.rapidtables.com/convert/color/cmyk-to-rgb.htm) ``cmyk_to_rgb`` and/or ``rgb_to_cmyk`` in there. However, this would create a new dependency between packages, i.e., from ``bob.io.image`` to ``bob.ip.color``. In fact, this might be a good idea anyways, i.e., in order to be able to get a color color image from any kind of image source (by automatically converting color types, if necessary).Manuel Günthersiebenkopf@googlemail.comManuel Günthersiebenkopf@googlemail.comhttps://gitlab.idiap.ch/bob/bob.io.image/-/issues/26GIF loading seems to be completely broken2018-08-27T08:19:36ZManuel Günthersiebenkopf@googlemail.comGIF loading seems to be completely brokenWhen reading a GIF image, it seems that all the image is the same color:
```
$ convert bob/io/image/data/grace_hopper.png test.gif
$ ./bin/python
>>> import bob.io.image, numpy
>>> image = bob.io.image.load("test.gif")
>>> numpy.all(imag...When reading a GIF image, it seems that all the image is the same color:
```
$ convert bob/io/image/data/grace_hopper.png test.gif
$ ./bin/python
>>> import bob.io.image, numpy
>>> image = bob.io.image.load("test.gif")
>>> numpy.all(image[0] == image[0][0][0])
True
>>> image2 = bob.io.image.load("bob/io/image/data/grace_hopper.png")
>>> numpy.all(image2[0] == image2[0][0][0])
False
```
I am using the GIF version which is coming with the conda, which is currently `libgif.so.7.0.0`. I have not checked other GIF versions.