Fix colorspace determinism with OrderedDict
parent
3e6cc20cb2
commit
0ce9a29f83
|
@ -1,4 +1,4 @@
|
|||
|
||||
import collections
|
||||
from .psparser import LIT
|
||||
|
||||
import six #Python 2+3 compatibility
|
||||
|
@ -21,17 +21,16 @@ class PDFColorSpace(object):
|
|||
return '<PDFColorSpace: %s, ncomponents=%d>' % (self.name, self.ncomponents)
|
||||
|
||||
|
||||
PREDEFINED_COLORSPACE = {}
|
||||
for (name, n) in six.iteritems({
|
||||
'CalRGB': 3,
|
||||
'CalGray': 1,
|
||||
'Lab': 3,
|
||||
'DeviceRGB': 3,
|
||||
'DeviceCMYK': 4,
|
||||
'DeviceGray': 1,
|
||||
'Separation': 1,
|
||||
'Indexed': 1,
|
||||
'Pattern': 1,
|
||||
}) :
|
||||
PREDEFINED_COLORSPACE = collections.OrderedDict()
|
||||
for (name, n) in [
|
||||
('CalRGB', 3),
|
||||
('CalGray', 1),
|
||||
('Lab', 3),
|
||||
('DeviceRGB', 3),
|
||||
('DeviceCMYK', 4),
|
||||
('DeviceGray', 1),
|
||||
('Separation', 1),
|
||||
('Indexed', 1),
|
||||
('Pattern', 1),
|
||||
]:
|
||||
PREDEFINED_COLORSPACE[name]=PDFColorSpace(name, n)
|
||||
|
Loading…
Reference in New Issue