colorxhtml: check validity of source_type

This commit is contained in:
Nils Philippsen
2010-11-09 11:28:30 +01:00
parent 63fcfb15a2
commit d2ebadcfb9

View File

@ -26,7 +26,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 = {
'&': '&',
@ -66,6 +66,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')