mayingzhen / nvidia-texture-tools

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

Targa loading is broken with FreeImage #141

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The current trunk version can't load TGA files properly, when compiled with 
HAVE_FREEIMAGE. The reason is that SeekProc in ImageIO.cpp lacks SEEK_END 
handling. Adding it resolves the problem:

Index: nvimage/ImageIO.cpp
===================================================================
--- nvimage/ImageIO.cpp (revision 1160)
+++ nvimage/ImageIO.cpp (working copy)
@@ -345,6 +345,9 @@
                case SEEK_SET :
                        s->seek(offset);
                        break;
+               case SEEK_END :
+                       s->seek(s->size() + offset);
+                       break;
                case SEEK_CUR :
                        s->seek(s->tell() + offset);
                        break;

Original issue reported on code.google.com by arseny.k...@gmail.com on 11 Oct 2010 at 5:39

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

Original comment by cast...@gmail.com on 13 Oct 2010 at 5:49

GoogleCodeExporter commented 8 years ago
Thanks for the patch!

Original comment by cast...@gmail.com on 13 Oct 2010 at 5:49