[Gtkradiant] [Bug 277] blackish.jpg JPG load crash
Thu, 27 Dec 2001 03:13:33 -0600
------- Additional Comments From email@example.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.)
RCS file: /cvs/GtkRadiant/libs/jpeg6/jpgload.cpp,v
retrieving revision 126.96.36.199
diff -u -a -r188.8.131.52 jpgload.cpp
--- libs/jpeg6/jpgload.cpp 21 Dec 2000 16:45:10 -0000 184.108.40.206
+++ 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!