예제 #1
0
파일: models.py 프로젝트: zaid100/tendenci
    def EXIF(self):
        try:
            content = default_storage.open(str(self.image)).read()
            im = PILImage.open(BytesIO(content))
        except IOError:
            return

        try:
            return EXIF.process_file(im)
        except:
            try:
                return EXIF.process_file(im, details=False)
            except:
                return {}
예제 #2
0
    def EXIF(self):
        try:
            content = default_storage.open(unicode(self.image)).read()
            im = PILImage.open(StringIO(content))
        except IOError:
            return

        try:
            return EXIF.process_file(im)
        except:
            try:
                return EXIF.process_file(im, details=False)
            except:
                return {}