Blob Blame History Raw
From 16bfd230e569709724166670987475756a6d3261 Mon Sep 17 00:00:00 2001
From: Nils Philippsen <nils@redhat.com>
Date: Tue, 9 Nov 2010 17:45:37 +0100
Subject: [PATCH] patch: colorxhtml

Squashed commit of the following:

commit f77a97fa0a7178394b81082749d6719849aa1508
Author: Nils Philippsen <nils@redhat.com>
Date:   Tue Nov 9 11:28:30 2010 +0100

    colorxhtml: check validity of source_type
    (cherry picked from commit d2ebadcfb906af972edb95807e2887af4ad76856)
---
 plug-ins/pygimp/plug-ins/colorxhtml.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/plug-ins/pygimp/plug-ins/colorxhtml.py b/plug-ins/pygimp/plug-ins/colorxhtml.py
index 0022c65..ed8e52d 100755
--- a/plug-ins/pygimp/plug-ins/colorxhtml.py
+++ b/plug-ins/pygimp/plug-ins/colorxhtml.py
@@ -27,7 +27,7 @@ from gimpfu import *
 
 gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
 
-(CHARS_SOURCE, CHARS_FILE, CHARS_PARAMETER) = range(3)
+all_source_types = (CHARS_SOURCE, CHARS_FILE, CHARS_PARAMETER) = range(3)
 
 escape_table = {
     '&': '&amp;',
@@ -67,6 +67,9 @@ def colorxhtml(img, drawable, filename, raw_filename,
     if not drawable.is_rgb or drawable.has_alpha:
         return
 
+    if source_type not in all_source_types:
+        return
+
     gimp.tile_cache_ntiles(width / gimp.tile_width() + 1)
 
     html = file(filename, 'w')
-- 
1.7.3.2