Fix for GIMP 1.3 gradient files

This commit is contained in:
hugovk 2014-08-26 12:14:58 +03:00
parent dbf0ee3631
commit 6b5871a484

View File

@ -99,7 +99,13 @@ class GimpGradientFile(GradientFile):
if fp.readline()[:13] != b"GIMP Gradient":
raise SyntaxError("not a GIMP gradient file")
count = int(fp.readline())
line = fp.readline()
# GIMP 1.2 gradient files don't contain a name, but GIMP 1.3 files do
if line.startswith("Name: "):
line = fp.readline().strip()
count = int(line)
gradient = []