changeset 51236:29a68043c861

(png_load): Remove `unused vars intent, image_gamma' warning.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 25 May 2003 17:46:34 +0000
parents 2710810008b2
children ed40623b1ca6
files src/xfns.c
diffstat 1 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Sun May 25 17:45:27 2003 +0000
+++ b/src/xfns.c	Sun May 25 17:46:34 2003 +0000
@@ -7579,8 +7579,7 @@
   png_byte channels;
   png_uint_32 row_bytes;
   int transparent_p;
-  double screen_gamma, image_gamma;
-  int intent;
+  double screen_gamma;
   struct png_memory_storage tbr;  /* Data to be read */
 
   /* Find out what file to load.  */
@@ -7719,19 +7718,22 @@
   screen_gamma = (f->gamma ? 1 / f->gamma / 0.45455 : 2.2);
 
 #if 0 /* Avoid double gamma correction for PNG images. */
-  /* Tell the PNG lib to handle gamma correction for us.  */
+  { /* Tell the PNG lib to handle gamma correction for us.  */
+    int intent;
+    double image_gamma;
 #if defined(PNG_READ_sRGB_SUPPORTED) || defined(PNG_WRITE_sRGB_SUPPORTED)
-  if (png_get_sRGB (png_ptr, info_ptr, &intent))
-    /* The libpng documentation says this is right in this case.  */
-    png_set_gamma (png_ptr, screen_gamma, 0.45455);
-  else
+    if (png_get_sRGB (png_ptr, info_ptr, &intent))
+      /* The libpng documentation says this is right in this case.  */
+      png_set_gamma (png_ptr, screen_gamma, 0.45455);
+    else
 #endif
-  if (png_get_gAMA (png_ptr, info_ptr, &image_gamma))
-    /* Image contains gamma information.  */
-    png_set_gamma (png_ptr, screen_gamma, image_gamma);
-  else
-    /* Use the standard default for the image gamma.  */
-    png_set_gamma (png_ptr, screen_gamma, 0.45455);
+      if (png_get_gAMA (png_ptr, info_ptr, &image_gamma))
+	/* Image contains gamma information.  */
+	png_set_gamma (png_ptr, screen_gamma, image_gamma);
+      else
+	/* Use the standard default for the image gamma.  */
+	png_set_gamma (png_ptr, screen_gamma, 0.45455);
+  }
 #endif /* if 0 */
 
   /* Handle alpha channel by combining the image with a background