From 464c854bd1319a775c7bb2c37c6ee9cd20a671e7 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sat, 2 Jan 2016 00:39:07 +0100 Subject: [PATCH] Run tests with Pillow 3.1.0.rc1 --- .travis.yml | 1 + sigal/image.py | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index ba9b5fb..67a0332 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ python: env: - PILLOW_VERSION=2.9.0 - PILLOW_VERSION=3.0.0 + - PILLOW_VERSION=3.1.0.rc1 before_install: # Dependencies to build PIL - sudo apt-get update -qq diff --git a/sigal/image.py b/sigal/image.py index f4e6c91..bcf4bf2 100644 --- a/sigal/image.py +++ b/sigal/image.py @@ -185,7 +185,7 @@ def get_exif_data(filename): if PIL.PILLOW_VERSION == '3.0.0': warnings.warn('Pillow 3.0.0 is broken with EXIF data, consider using ' - 'a previous version if you want to use EXIF data.') + 'another version if you want to use EXIF data.') img = PILImage.open(filename) try: @@ -232,10 +232,9 @@ def get_exif_tags(data): if 'FNumber' in data: fnumber = data['FNumber'] try: - # Pillow < 3.0 simple['fstop'] = float(fnumber[0]) / fnumber[1] except IndexError: - # Pillow >= 3.0 + # Pillow == 3.0 simple['fstop'] = float(fnumber[0]) except Exception: logger.debug('Skipped invalid FNumber: %r', fnumber, exc_info=True) @@ -243,10 +242,9 @@ def get_exif_tags(data): if 'FocalLength' in data: focal = data['FocalLength'] try: - # Pillow < 3.0 simple['focal'] = round(float(focal[0]) / focal[1]) except IndexError: - # Pillow >= 3.0 + # Pillow == 3.0 simple['focal'] = round(focal[0]) except Exception: logger.debug('Skipped invalid FocalLength: %r', focal, @@ -258,7 +256,7 @@ def get_exif_tags(data): try: simple['exposure'] = exptime[0] / float(exptime[1]) except IndexError: - # Pillow >= 3.0 + # Pillow == 3.0 simple['exposure'] = exptime[0] elif isinstance(exptime, int): simple['exposure'] = str(exptime) @@ -267,7 +265,7 @@ def get_exif_tags(data): if 'ISOSpeedRatings' in data: if isinstance(data['ISOSpeedRatings'], tuple): - # Pillow >= 3.0 + # Pillow == 3.0 simple['iso'] = data['ISOSpeedRatings'][0] else: simple['iso'] = data['ISOSpeedRatings'] @@ -277,7 +275,7 @@ def get_exif_tags(data): # Remove null bytes at the end if necessary date = data['DateTimeOriginal'].rsplit('\x00')[0] except AttributeError: - # Pillow >= 3.0 + # Pillow == 3.0 date = data['DateTimeOriginal'][0] try: