[Win32] image loading tests fail
DavidLudwig opened this issue · 4 comments
On Win32, as of commit a805fc8, and using build instructions listed in BUILDING.md, image-loading tests fail.
Log output to follow.
Steps to reproduce:
- build io2d on Win32, according to instructions in BUILDING.md
- build all targets
- run the built copy of tests.exe
Expected Result: all tests pass
Observed Results: image-loading tests fail
Log Output (from tests.exe):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests.exe is a Catch v2.1.2 host application.
Run with -? for options
-------------------------------------------------------------------------------
IO2D properly decodes PNG images
-------------------------------------------------------------------------------
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(9)
...............................................................................
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(9): FAILED:
due to unexpected exception with message:
operation canceled
-------------------------------------------------------------------------------
IO2D properly encodes PNG images
-------------------------------------------------------------------------------
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(20)
...............................................................................
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(20): FAILED:
due to unexpected exception with message:
no protocol option
-------------------------------------------------------------------------------
IO2D properly decodes JPG images
-------------------------------------------------------------------------------
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(31)
...............................................................................
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(31): FAILED:
due to unexpected exception with message:
no protocol option
-------------------------------------------------------------------------------
IO2D properly encodes JPG images
-------------------------------------------------------------------------------
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(42)
...............................................................................
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(42): FAILED:
due to unexpected exception with message:
no protocol option
-------------------------------------------------------------------------------
IO2D properly decodes TIFF images
-------------------------------------------------------------------------------
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(54)
...............................................................................
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(54): FAILED:
due to unexpected exception with message:
no protocol option
-------------------------------------------------------------------------------
IO2D properly encodes TIFF images
-------------------------------------------------------------------------------
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(65)
...............................................................................
c:\users\davidl\documents\code\p0267_refimpl\p0267_refimpl\tests\image_io.cpp(65): FAILED:
due to unexpected exception with message:
no protocol option
===============================================================================
test cases: 81 | 75 passed | 4 failed | 2 failed as expected
assertions: 56552 | 56546 passed | 4 failed | 2 failed as expected
C:\Users\davidl\Documents\Code\P0267_RefImpl\Debug\P0267_RefImpl\Tests\Debug\tests.exe (process 4588) exited with code 4.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
I've done a bit of step-debugging (in Visual Studio), through io2d, in regards to this Here's an update:
- io2d's call(s) to Graphicsmagick's ReadImage() function, are failing.
- ReadImage() fails to find GraphicsMagick's png loader
- GraphicsMagick's png loader appears to never be initialized, insofar that:
- GraphicsMagick's RegisterPNGImage() function never gets called
- subcalls of ReadImage attempt to load GraphicsMagick's png loader via a .dll, which is never found, nor is installed by vcpkg.
The copy of Graphicsmagick provided by vcpkg does not appear to load .png files, even when used outside of io2d. I.e. it appears to be broken, unfortunately.
Compiling one of Graphicsmagick's sample programs, convert.c, as listed at http://www.graphicsmagick.org/api/api.html, appears to show a similar (the same, perhaps?) bug, whereby .png files do not seem to get loaded.
This bug is still showing up in Appveyor CI build + test runs. For example: https://ci.appveyor.com/project/cpp-io2d/p0267-refimpl/build/1.0.52
It looks like Appveyor's CI servers come with an older copy of vcpkg installed, one with a broken version of GraphicsMagick (see for more info: microsoft/vcpkg#4215 ). Updating this seems prudent, to me at least.
Fixed via #95