mayingzhen / nvidia-texture-tools

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

PNG -> DDS red and blue channels are swapped #164

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Convert a .png image to .dds using nvcompress.exe.

This results red and blue channels being swapped.

Compiled texture-tools from rev. 1261.

By swapping red and blue in nv::ImageIO::loadSTB fixes the issue. Tested with 
.PNG and .JPG files.

Original issue reported on code.google.com by fingerso...@gmail.com on 5 May 2011 at 9:42

GoogleCodeExporter commented 8 years ago
Attaching a patch for this issue.

Without this the trunk version is broken for everything except TGA and PSD 
files (given default configuration).

Original comment by arseny.k...@gmail.com on 20 Jun 2011 at 6:16

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks, this looks good. Maybe I should switch to RGBA byte order internally as 
well. That would make things more simple. In the mean time I'll just apply your 
patch.

Original comment by cast...@gmail.com on 20 Jun 2011 at 6:43

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1262.

Original comment by cast...@gmail.com on 20 Jun 2011 at 6:45

GoogleCodeExporter commented 8 years ago
Thanks for the quick response! This introduces a memory leak (serves me right 
for writing code late at night), but at least fixes the results :) Memory leaks 
may become a problem for me because I'm using nvtt as a DLL and convert many 
textures possibly many times, so I'll look into it and will probably submit 
another patch.

Original comment by arseny.k...@gmail.com on 20 Jun 2011 at 4:55

GoogleCodeExporter commented 8 years ago
I just fixed this.

Original comment by cast...@gmail.com on 20 Jun 2011 at 7:11