2005-09-01  Kristian Høgsberg  <krh@redhat.com>

        * NEWS:
        * configure.ac: Release 0.4.2.

        * glib/poppler-page.cc (poppler_page_prepare_output_dev): Patch
        from Marco to fix more rotation special cases.
diff --git a/ChangeLog b/ChangeLog
index a756481..552994b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-09-01  Kristian Høgsberg  <krh@redhat.com>
+
+	* NEWS:
+	* configure.ac: Release 0.4.2.
+
+	* glib/poppler-page.cc (poppler_page_prepare_output_dev): Patch
+	from Marco to fix more rotation special cases.
+
 2005-08-29  Kristian Høgsberg  <krh@redhat.com>
 
 	* configure.ac (HAVE_FREETYPE_H): Patch from Hiroyuki Ikezoe: Set
diff --git a/NEWS b/NEWS
index a21455e..b3fc991 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+Release 0.4.2
+
+	- Fix a rotation bug.
+	- Fix freetype pkg-config check
+	- Default to built-in decompression.
+
 Release 0.4.1
 
 	- Fix and simplify glib rotation API.
diff --git a/configure.ac b/configure.ac
index 3b84321..8ef3fc8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 dnl Based on Xpdf configure.in and evince configure.ac
 
 AC_PREREQ(2.59)
-AC_INIT(poppler, 0.4.1)
+AC_INIT(poppler, 0.4.2)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 AM_CONFIG_HEADER(config.h)
 AM_CONFIG_HEADER(poppler/poppler-config.h)
@@ -87,7 +87,7 @@
 	      AC_HELP_STRING([--disable-zlib],
 	                     [Don't build against zlib.]),
               enable_zlib=$enableval,
-              enable_zlib="try")
+              enable_zlib="no")
 if test x$enable_zlib = xyes; then
   AC_CHECK_LIB([z], [inflate],,
 	       AC_MSG_ERROR("*** zlib library not found ***"))
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc
index 4cafd12..68e2aaf 100644
--- a/glib/poppler-page.cc
+++ b/glib/poppler-page.cc
@@ -123,9 +123,12 @@
   CairoOutputDev *output_dev;
   cairo_surface_t *surface;
   int cairo_width, cairo_height, cairo_rowstride;
+  int rotate;
   unsigned char *cairo_data;
 
-  if (rotation == 90 || rotation == 270) {
+  rotate = (rotation + page->page->getRotate()) % 360;
+
+  if (rotate == 90 || rotate == 270) {
     cairo_width = MAX ((int)(page->page->getHeight() * scale + 0.5), 1);
     cairo_height = MAX ((int)(page->page->getWidth() * scale + 0.5), 1);
   } else {