From 259a2ce2b22aebad278d36abe4dd72966e25806f Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 31 Mar 2019 08:09:01 +1100 Subject: [PATCH] Removed camelcase --- src/PIL/ImageFile.py | 4 ++-- src/PIL/JpegImagePlugin.py | 2 +- src/PIL/PngImagePlugin.py | 2 +- src/PIL/TiffImagePlugin.py | 4 ++-- src/PIL/WebPImagePlugin.py | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index 1c2c06aa3..99cb7ec37 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -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: diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py index 0f50ff352..946006c75 100644 --- a/src/PIL/JpegImagePlugin.py +++ b/src/PIL/JpegImagePlugin.py @@ -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 = ( diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index 9aea1f059..588cee02f 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -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) diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index 2c703e32c..77688e56b 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -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) diff --git a/src/PIL/WebPImagePlugin.py b/src/PIL/WebPImagePlugin.py index 6b85da254..4a11a18c1 100644 --- a/src/PIL/WebPImagePlugin.py +++ b/src/PIL/WebPImagePlugin.py @@ -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: