joechenq / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

trunk : Save RGB PNG Image not working without FreeImage #127

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build trunk with -D HAVE_FREEIMAGE:BOOL=TRUE
2. Run nvtestsuite
3. Build trunk with -D HAVE_FREEIMAGE:BOOL=FALSE
4. Run nvtestsuite
5. Compare resulting PNG images

What is the expected output? What do you see instead?

Test passes in both cases.
The PNG images should be identical, but are not (see attached files).
It seems that PNG save transforms are not correct for RGB images
(ImageIO.cpp, around line 1237) : solid alpha channel happens to take the
place of the red channel it seems.

Tried to fix, but I have no experience in libpng and did not manage anything.

Stumbled on this while trying to make something working for a new
Format_Grey type.

Original issue reported on code.google.com by nicolas....@gtempaccount.com on 3 Jun 2010 at 9:53

Attachments:

GoogleCodeExporter commented 9 years ago
Hmm... that's strange, I think this used to work at some point. Can you try 
with the 
PNG_TRANSFORM_SWAP_ALPHA or without the PNG_TRANSFORM_RGB flag?

Original comment by cast...@gmail.com on 3 Jun 2010 at 11:37

GoogleCodeExporter commented 9 years ago
I tried various combinations, but all I can manage is to have correct output 
when
color_type is PNG_COLOR_TYPE_RGBA, otherwise it won't work, I find alpha channel
values used as a color.

Without PNG_TRANSFORM_RGB, the images get blueish instead of redish, but the
PNG_TRANSFORM_SWAP_ALPHA seems to have no effect for RGB output. It has an 
impact on
RGBA output though (breaks it).

Also tried with PNG_TRANSFORM_STRIP_ALPHA without much success.

Original comment by nicolas....@gtempaccount.com on 4 Jun 2010 at 9:23

GoogleCodeExporter commented 9 years ago
Maybe I only tested the RGBA color type. I'll take a look this weekend.

Original comment by cast...@gmail.com on 4 Jun 2010 at 5:29

GoogleCodeExporter commented 9 years ago

Original comment by cast...@gmail.com on 4 Jun 2010 at 5:30