[Gtkradiant] [Bug 277] blackish.jpg JPG load crash
gtkradiant@zerowing.idsoftware.com
gtkradiant@zerowing.idsoftware.com
Thu, 27 Dec 2001 03:13:33 -0600
http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=277
------- Additional Comments From ttimo@idsoftware.com 2001-12-27 03:13 -------
Here's a one line (except for comments) patch that works around the
problem in stable. This is tested on win32. I also looked through
and ran the unstable code, and verified that it doesn't have the
problem. (The libs/jpeg6/jpgload.cpp file is not used, instead
plugins/image/jpeg.cpp does the equivalent work, correctly.)
Index: libs/jpeg6/jpgload.cpp
===================================================================
RCS file: /cvs/GtkRadiant/libs/jpeg6/jpgload.cpp,v
retrieving revision 1.2.4.2
diff -u -a -r1.2.4.2 jpgload.cpp
--- libs/jpeg6/jpgload.cpp 21 Dec 2000 16:45:10 -0000 1.2.4.2
+++ libs/jpeg6/jpgload.cpp 27 Dec 2001 01:56:46 -0000
@@ -65,10 +65,17 @@
*/
/* Step 4: set parameters for decompression */
-
- /* In this example, we don't need to change any of the defaults set by
- * jpeg_read_header(), so we do nothing here.
- */
+ /*
+ * +++rfm
+ * workaround for single component .jpg files.
+ * All textures are assumed to be rgba in the radiant code, so
+ * force RGB output. In this version of libjpeg, GREYSCALE -> RGB
+ * conversion is not supported (the most recent version from
+ * http://www.ijg.org/ does), but with this we get a nice error
+ * message in the console and can work with the textures even though
+ * it is displayed with the 'unable to load texture' icon.
+ */
+ cinfo.out_color_space = JCS_RGB;
/* Step 5: Start decompressor */
------- You are receiving this mail because: -------
Whoops! I have no idea!