2006-05-22  Kristian Høgsberg  <krh@redhat.com>

	Patch from Rainer Keller to fix the ImageOutputDev (#6984).

	* utils/ImageOutputDev.cc (drawImage): Upate to work with new
	16-bit color representation.

	* utils/ImageOutputDev.h: Return gTrue for needNonText().
diff --git a/ChangeLog b/ChangeLog
index 8f2835f..acb5554 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-05-22  Kristian Høgsberg  <krh@redhat.com>
+
+	Patch from Rainer Keller to fix the ImageOutputDev (#6984).
+	
+	* utils/ImageOutputDev.cc (drawImage): Upate to work with new
+	16-bit color representation.
+
+	* utils/ImageOutputDev.h: Return gTrue for needNonText().
+
 2006-05-21  Kristian Høgsberg  <krh@redhat.com>
 
 	* poppler/CairoFontEngine.cc:
diff --git a/NEWS b/NEWS
index 065c644..92abc7f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Release 0.5.2
+
+	- 
+
 Release 0.5.1
 
 	- Support for embedded files.
diff --git a/utils/ImageOutputDev.cc b/utils/ImageOutputDev.cc
index 04e4646..6c2b428 100644
--- a/utils/ImageOutputDev.cc
+++ b/utils/ImageOutputDev.cc
@@ -184,9 +184,9 @@
       p = imgStr->getLine();
       for (x = 0; x < width; ++x) {
 	colorMap->getRGB(p, &rgb);
-	fputc((int)(rgb.r * 255 + 0.5), f);
-	fputc((int)(rgb.g * 255 + 0.5), f);
-	fputc((int)(rgb.b * 255 + 0.5), f);
+	fputc(colToByte(rgb.r), f);
+	fputc(colToByte(rgb.g), f);
+	fputc(colToByte(rgb.b), f);
 	p += colorMap->getNumPixelComps();
       }
     }
diff --git a/utils/ImageOutputDev.h b/utils/ImageOutputDev.h
index 404e2f8..90c2e6f 100644
--- a/utils/ImageOutputDev.h
+++ b/utils/ImageOutputDev.h
@@ -45,7 +45,7 @@
   virtual GBool interpretType3Chars() { return gFalse; }
 
   // Does this device need non-text content?
-  virtual GBool needNonText() { return gFalse; }
+  virtual GBool needNonText() { return gTrue; }
 
   //---- get info about output device