Fix #314: Remote commands for thumbnail maintenance
[geeqie.git] / src / pixbuf_util.c
index c168172..024e5ba 100644 (file)
@@ -1,16 +1,24 @@
 /*
- * Geeqie
- * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2004 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
  *
  * Author: John Ellis
  *
- * 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!
+ * 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 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 General Public License for more details.
+ *
+ * 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 "pixbuf_util.h"
 #include "exif.h"
@@ -136,13 +144,13 @@ static void register_stock_icon(const gchar *key, GdkPixbuf *pixbuf)
 {
        static GtkIconFactory *icon_factory = NULL;
        GtkIconSet *icon_set;
-       
+
        if (!icon_factory)
                {
                icon_factory = gtk_icon_factory_new();
                gtk_icon_factory_add_default(icon_factory);
                }
-       
+
        icon_set = gtk_icon_set_new_from_pixbuf(pixbuf);
        gtk_icon_factory_add(icon_factory, key, icon_set);
 }
@@ -167,7 +175,7 @@ gboolean register_theme_icon_as_stock(const gchar *key, const gchar *icon)
        GError *error = NULL;
 
        icon_theme = gtk_icon_theme_get_default();
-       
+
        if (gtk_icon_theme_has_icon(icon_theme, key)) return FALSE;
 
        pixbuf = gtk_icon_theme_load_icon(icon_theme,
@@ -175,7 +183,7 @@ gboolean register_theme_icon_as_stock(const gchar *key, const gchar *icon)
                            64, /* size */
                            0,  /* flags */
                            &error);
-       if (!pixbuf) 
+       if (!pixbuf)
                {
                if (error)
                        {
@@ -183,7 +191,7 @@ gboolean register_theme_icon_as_stock(const gchar *key, const gchar *icon)
                        g_error_free(error);
                        error = NULL;
                        }
-                       
+
                if (strchr(icon, '.'))
                        {
                        /* try again without extension */
@@ -203,7 +211,7 @@ gboolean register_theme_icon_as_stock(const gchar *key, const gchar *icon)
                }
 
        if (!pixbuf) return FALSE;
-       
+
        register_stock_icon(key, pixbuf);
        return TRUE;
 }
@@ -231,7 +239,7 @@ gboolean pixbuf_scale_aspect(gint req_w, gint req_h,
 GdkPixbuf *pixbuf_fallback(FileData *fd, gint requested_width, gint requested_height)
 {
        GdkPixbuf *pixbuf = pixbuf_inline(PIXBUF_INLINE_BROKEN); /* FIXME use different images according to FORMAT_CLASS */
-       
+
        if (requested_width && requested_height)
                {
                gint w = gdk_pixbuf_get_width(pixbuf);
@@ -349,10 +357,6 @@ GdkPixbuf *pixbuf_copy_rotate_90(GdkPixbuf *src, gboolean counter_clockwise)
        gint dw, dh, drs;
        guchar *s_pix;
        guchar *d_pix;
-#if 0
-       guchar *sp;
-       guchar *dp;
-#endif
        gint i, j;
        gint a;
        GdkPixbuf *buffer;
@@ -512,7 +516,7 @@ GdkPixbuf *pixbuf_apply_orientation(GdkPixbuf *pixbuf, gint orientation)
 {
        GdkPixbuf *dest;
        GdkPixbuf *tmp = NULL;
-       
+
        switch (orientation)
                {
                case EXIF_ORIENTATION_TOP_LEFT:
@@ -782,7 +786,6 @@ void pixbuf_draw_layout(GdkPixbuf *pixbuf, PangoLayout *layout, GtkWidget *widge
 {
        GdkPixbuf *buffer;
        gint w, h;
-       GdkGC *gc;
        gint sx, sy;
        gint dw, dh;
        cairo_surface_t *source;
@@ -1010,20 +1013,6 @@ static gboolean util_clip_line(gdouble clip_x, gdouble clip_y, gdouble clip_w, g
                if (y1 < clip_y || y2 > clip_y + clip_h) return FALSE;
                }
 
-#if 0
-       if (x1 >= clip_x && x2 <= clip_x + clip_w)
-               {
-               if (y1 < y2)
-                       {
-                       if (y1 >= clip_y && y2 <= clip_y + clip_h) return TRUE;
-                       }
-               else
-                       {
-                       if (y2 >= clip_y && y1 <= clip_y + clip_h) return TRUE;
-                       }
-               }
-#endif
-
        d = x2 - x1;
        if (d > 0.0)
                {