colorxhtml: check validity of source_type
This commit is contained in:
@ -26,7 +26,7 @@ from gimpfu import *
|
|||||||
|
|
||||||
gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
|
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 = {
|
escape_table = {
|
||||||
'&': '&',
|
'&': '&',
|
||||||
@ -66,6 +66,9 @@ def colorxhtml(img, drawable, filename, raw_filename,
|
|||||||
if not drawable.is_rgb or drawable.has_alpha:
|
if not drawable.is_rgb or drawable.has_alpha:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if source_type not in all_source_types:
|
||||||
|
return
|
||||||
|
|
||||||
gimp.tile_cache_ntiles(width / gimp.tile_width() + 1)
|
gimp.tile_cache_ntiles(width / gimp.tile_width() + 1)
|
||||||
|
|
||||||
html = file(filename, 'w')
|
html = file(filename, 'w')
|
||||||
|
Reference in New Issue
Block a user