Roland Posted August 6, 2021 Share Posted August 6, 2021 I tested the simple code in the "Create an Image Viewer" in the Tutorials. All images I tested works well when loaded. However some of the become distorted and grayscale when saved, but only some of them. I have enclosed such an image. The original and the one saved by the Image Viewer example 1 Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Josh Posted August 19, 2021 Share Posted August 19, 2021 I was able to re-save the image above with no problem: Either the bug got fixed or maybe the forum system is automatically converting your uploaded image? Maybe attach the image in a zip file to ensure it does not get modified? My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted August 19, 2021 Share Posted August 19, 2021 When I compile the plugin from my current source, your original image loads and looks wrong, like your second image. This could be an error in the loading code, or an error in the translation from a pixmap to a Windows bitmap... My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted August 19, 2021 Share Posted August 19, 2021 It appears to me that the error is in FreeImage itself, but I am not 100% sure yet... My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Solution Josh Posted August 19, 2021 Solution Share Posted August 19, 2021 It seems like FreeImage doesn't work correctly with 24-bit images. I am adding a command to convert to 32-bit and I think that solves this... https://github.com/Leadwerks/PluginSDK/blob/master/Plugins/FI Texture Loader/main.cpp 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts