Remove Image.key, add Letter.key.
This commit is contained in:
parent
08a6d004e7
commit
a537f2140c
2 changed files with 6 additions and 5 deletions
|
|
@ -127,11 +127,6 @@ class Image(object):
|
|||
def isspace(self):
|
||||
return not _is_nonblank(self.bitmap)
|
||||
|
||||
@property
|
||||
def key(self):
|
||||
"""Return a byte string uniquely representing the image."""
|
||||
return self.tostring()
|
||||
|
||||
def tostring(self):
|
||||
"""Serialize the image as a string."""
|
||||
height, width, *_ = self.shape
|
||||
|
|
|
|||
|
|
@ -165,6 +165,12 @@ class Letter(PageObject):
|
|||
super().__init__(image)
|
||||
self.elevation = elevation
|
||||
|
||||
@property
|
||||
def key(self):
|
||||
"""Return a dictionary key uniquely representing this letter."""
|
||||
return self.elevation, self.image.tostring()
|
||||
|
||||
|
||||
|
||||
class Space(Letter):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue