Fixes for Python 3

This commit is contained in:
hugovk 2014-07-30 20:43:34 +03:00
parent 515bb6e14d
commit f5440cc3e1
2 changed files with 5 additions and 5 deletions

View File

@ -237,11 +237,11 @@ def getiptcinfo(im):
# extract the IPTC/NAA resource
try:
app = im.app["APP13"]
if app[:14] == "Photoshop 3.0\x00":
if app[:14] == b"Photoshop 3.0\x00":
app = app[14:]
# parse the image resource block
offset = 0
while app[offset:offset+4] == "8BIM":
while app[offset:offset+4] == b"8BIM":
offset += 4
# resource code
code = JpegImagePlugin.i16(app, offset)

View File

@ -38,8 +38,8 @@ class TestFileIptc(PillowTestCase):
# Assert
self.assertIsInstance(iptc, dict)
self.assertEqual(iptc[(2, 90)], "Budapest")
self.assertEqual(iptc[(2, 101)], "Hungary")
self.assertEqual(iptc[(2, 90)], b"Budapest")
self.assertEqual(iptc[(2, 101)], b"Hungary")
# _FIXME: is_raw() is disabled. Should we remove it?
def test__is_raw_equal_zero(self):
@ -56,7 +56,7 @@ class TestFileIptc(PillowTestCase):
def test_i(self):
# Arrange
c = "a"
c = b"a"
# Act
ret = IptcImagePlugin.i(c)