[gegl] jpeg-load: Don't start decompress when querying image size



commit d3625ff8574fa8234d387261c8361d83481a5117
Author: Mukund Sivaraman <muks banu com>
Date:   Wed Sep 7 16:42:21 2011 +0530

    jpeg-load: Don't start decompress when querying image size
    
    It generates in a warning from libjpeg (when an error handler
    is installed). Besides it's wasteful.

 operations/external/jpg-load.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/operations/external/jpg-load.c b/operations/external/jpg-load.c
index e429708..eaacdcd 100644
--- a/operations/external/jpg-load.c
+++ b/operations/external/jpg-load.c
@@ -53,7 +53,6 @@ gegl_jpg_load_query_jpg (const gchar *path,
   jpeg_stdio_src (&cinfo, infile);
 
   (void) jpeg_read_header (&cinfo, TRUE);
-  (void) jpeg_start_decompress (&cinfo);
 
   if (cinfo.output_components != 3)
     {
@@ -63,9 +62,9 @@ gegl_jpg_load_query_jpg (const gchar *path,
     }
 
   if (width)
-    *width = cinfo.output_width;
+    *width = cinfo.image_width;
   if (height)
-    *height = cinfo.output_height;
+    *height = cinfo.image_height;
 
   jpeg_destroy_decompress (&cinfo);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]