mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Fixes for Python 3
This commit is contained in:
parent
515bb6e14d
commit
f5440cc3e1
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user