| Summary: | Cannot load images with ImageIO enabled on Mac OS X | ||
|---|---|---|---|
| Product: | SDL_image | Reporter: | toukoaozaki |
| Component: | misc | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | gabomdq, sdl |
| Version: | unspecified | ||
| Hardware: | x86 | ||
| OS: | Mac OS X 10.5 (Intel) | ||
| Attachments: |
Test source/script, input image file and my result
Screenshot of SDLInvaders showing image corruption towards bottom of sprites. Fix that can apply to changeset 292 and later. |
||
|
Description
toukoaozaki
2012-02-06 19:38:31 UTC
ADDED: SDL_image version is 1.2.12. (In reply to comment #1) Sorry for confusion. The version is actually 1.2.15. I built SDL_image with ImageIO and tested it on all the images I have here and didn't have any problems. Can you post a link to an image that doesn't work? Thanks! Created attachment 817 [details]
Test source/script, input image file and my result
I'm attaching a test program and script with input image file.
I have MacPorts version (with ImageIO) in /opt/local/lib, and source-compiled version without ImageIO in /usr/local/lib.
wo_imageio.txt is the result when linked against the library in /usr/local/lib, and w_imageio.txt is the result when linked against the library in /opt/local/lib. The result was the same for the source compiled version before I manually disabled ImageIO through configure.
This is weird, if this is happening only to me. What would be a possible cause?
I tested image loading with ImageIO last week with the latest SDL_image and OS X 10.7, it worked fine for PNG files at least. I can confirm this bug exists - MacOSX 10.5.8; XCode 3.1.4; All SDL based games I've tried are impacted (widelands, SDLInvaders). I've seen both black images and image corruption. For example, the splash screen of SDLInvaders is black, and in-game it has corrupt graphics (see attachment) I have traced the problem to be starting when changeset 292 was applied to the SDL_image library (changeset 289 works; 290 & 291 are not code updates) - so this is first seen with SDL_image 1.2.11. SDL_image 1.2.12 is also affected. http://hg.libsdl.org/SDL_image/rev/5953114c0d27 I have a MacPorts issue open for downstream visibility: https://trac.macports.org/ticket/37453 Workaround: compile SDL_image with --disable-imageio. Let me know if there's anything I can help check, though ImageIO is not an area I'm familiar with. Created attachment 1003 [details]
Screenshot of SDLInvaders showing image corruption towards bottom of sprites.
Created attachment 1005 [details] Fix that can apply to changeset 292 and later. The attached diff fixes the library so ImageIO can be used and images are displayed again without corruption and black screens. (Based on http://pastebin.com/T3s15UXF and http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html) I suspect the matrix passed to CGColorSpaceCreateCalibratedRGB() as implemented in r292 is invalid and the CoreGraphics framework on 10.5 doesn't reject it, but later ones do. Unfortunately all the documentation I can find doesn't actually specify what the valid range of values of the arguments is. Fixed, thanks! http://hg.libsdl.org/SDL_image/rev/3999783ed889 Fixed, thanks! http://hg.libsdl.org/SDL_image/rev/3999783ed889 |