Fix compile errors
[geeqie.git] / src / image_load_jpeg.c
index 4fbbd29..2bb27a8 100644 (file)
@@ -1,43 +1,29 @@
 /*
- * Geeqie
- * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2011 The Geeqie Team
- *
- * Author: Vladimir Nadvornik
- *
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
- */
-
-/* based on code from GdkPixbuf library - JPEG image loader
- *
  * Copyright (C) 1999 Michael Zucchi
  * Copyright (C) 1999 The Free Software Foundation
- *
- * Progressive loading code Copyright (C) 1999 Red Hat, Inc.
+ * Copyright (C) 2004 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
  *
  * Authors: Michael Zucchi <zucchi@zedzone.mmc.com.au>
  *          Federico Mena-Quintero <federico@gimp.org>
  *          Michael Fulbright <drmike@redhat.com>
+ *         Vladimir Nadvornik
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-
 #include "main.h"
 
 #include "image-load.h"
@@ -110,7 +96,8 @@ static void
 convert_cmyk_to_rgb (struct jpeg_decompress_struct *cinfo,
                     guchar **lines)
 {
-       gint i, j;
+       gint i;
+       guint j;
 
        g_return_if_fail (cinfo != NULL);
        g_return_if_fail (cinfo->output_components == 4);
@@ -234,7 +221,7 @@ static void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
 {
        struct jpeg_source_mgr* src = (struct jpeg_source_mgr*) cinfo->src;
 
-       if (num_bytes > src->bytes_in_buffer)
+       if ((gulong)num_bytes > src->bytes_in_buffer)
                {
                ERREXIT(cinfo, JERR_INPUT_EOF);
                }
@@ -280,6 +267,7 @@ static gboolean image_loader_jpeg_load (gpointer loader, const guchar *buf, gsiz
        struct error_handler_data jerr;
 
        lj->stereo = FALSE;
+//     DEBUG_1("TG: JPG requested size w=%d:h=%d", lj->requested_width > 0, lj->requested_height);
 
        MPOData *mpo = jpeg_get_mpo_data(buf, count);
        if (mpo && mpo->num_images > 1)
@@ -360,6 +348,7 @@ static gboolean image_loader_jpeg_load (gpointer loader, const guchar *buf, gsiz
 
        lj->requested_width = lj->stereo ? cinfo.image_width * 2: cinfo.image_width;
        lj->requested_height = cinfo.image_height;
+//     DEBUG_1("TG: JPG requested size v2 w=%d:h=%d", lj->requested_width > 0, lj->requested_height);
        lj->size_cb(loader, lj->requested_width, lj->requested_height, lj->data);
 
        cinfo.scale_num = 1;