Removed camelcase

This commit is contained in:
Andrew Murray 2019-03-31 08:09:01 +11:00
parent 64910d1921
commit 259a2ce2b2
5 changed files with 8 additions and 8 deletions

View File

@ -751,7 +751,7 @@ class Exif(MutableMapping):
self._data[0x8825] = ifd
self._ifds[0x8825] = ifd
def toBytes(self, offset=0):
def tobytes(self, offset=0):
from . import TiffImagePlugin
if self.endian == "<":
head = b"II\x2A\x00\x08\x00\x00\x00"
@ -760,7 +760,7 @@ class Exif(MutableMapping):
ifd = TiffImagePlugin.ImageFileDirectory_v2(ifh=head)
for tag, value in self._data.items():
ifd[tag] = value
return b"Exif\x00\x00"+head+ifd.toBytes(offset)
return b"Exif\x00\x00"+head+ifd.tobytes(offset)
def get_ifd(self, tag):
if tag not in self._ifds and tag in self._data:

View File

@ -726,7 +726,7 @@ def _save(im, fp, filename):
exif = info.get("exif", b"")
if isinstance(exif, ImageFile.Exif):
exif = exif.toBytes()
exif = exif.tobytes()
# get keyword arguments
im.encoderconfig = (

View File

@ -887,7 +887,7 @@ def _save(im, fp, filename, chunk=putchunk):
exif = im.encoderinfo.get("exif", im.info.get("exif"))
if exif:
if isinstance(exif, ImageFile.Exif):
exif = exif.toBytes(8)
exif = exif.tobytes(8)
if exif.startswith(b"Exif\x00\x00"):
exif = exif[6:]
chunk(fp, b"eXIf", exif)

View File

@ -785,7 +785,7 @@ class ImageFileDirectory_v2(MutableMapping):
warnings.warn(str(msg))
return
def toBytes(self, offset=0):
def tobytes(self, offset=0):
# FIXME What about tagdata?
result = self._pack("H", len(self._tags_v2))
@ -859,7 +859,7 @@ class ImageFileDirectory_v2(MutableMapping):
fp.write(self._prefix + self._pack("HL", 42, 8))
offset = fp.tell()
result = self.toBytes(offset)
result = self.tobytes(offset)
fp.write(result)
return offset + len(result)

View File

@ -218,7 +218,7 @@ def _save_all(im, fp, filename):
icc_profile = im.encoderinfo.get("icc_profile", "")
exif = im.encoderinfo.get("exif", "")
if isinstance(exif, ImageFile.Exif):
exif = exif.toBytes()
exif = exif.tobytes()
xmp = im.encoderinfo.get("xmp", "")
if allow_mixed:
lossless = False
@ -319,7 +319,7 @@ def _save(im, fp, filename):
icc_profile = im.encoderinfo.get("icc_profile", "")
exif = im.encoderinfo.get("exif", "")
if isinstance(exif, ImageFile.Exif):
exif = exif.toBytes()
exif = exif.tobytes()
xmp = im.encoderinfo.get("xmp", "")
if im.mode not in _VALID_WEBP_LEGACY_MODES: