Esempio n. 1
0
 def thumbnail(self):
     if self.thumbnail_path:
         thumbnail = Path(self.path, self.thumbnail_path)
         if thumbnail.exists():
             path, exif = read_exif([thumbnail.absolute()])[0]
             return Image(path, exif)
     return None
Esempio n. 2
0
 def videos(self):
     result = set()
     for i in self.include:
         for p in self._filter_hidden(self.path.glob(i)):
             result.add(p.absolute())
     for i in self.exclude:
         for p in self._filter_hidden(self.path.glob(i)):
             result.remove(p.absolute())
     videos = [Video(p, e)
               for p, e in read_exif(list(result))] if result else []
     return sorted(videos, key=lambda x: getattr(x, self.sortby))
Esempio n. 3
0
    def test_exif_properties(self):
        _, exif = read_exif([Path(self.test_img1)])[0]

        self.assertEqual(exif.name, 'image-01')
        self.assertEqual(exif.maker, 'Fujifilm')
        self.assertEqual(exif.model, 'X-T30')
        self.assertEqual(exif.lens_model, 'XF35mmF2 R WR')
        self.assertEqual(exif.iso, 320)
        self.assertEqual(exif.fnumber, 2.0)
        self.assertEqual(exif.exposure_time, '1/420')
        self.assertEqual(exif.focal_length, '35.0 mm')
        self.assertEqual(exif.orientation, 0)
        self.assertEqual(exif.datetime_original, datetime(2019, 8, 21, 18, 49, 49))
        self.assertEqual(exif.style, 'Astia')
Esempio n. 4
0
 def images(self, all=False):
     result = set()
     for i in self.include:
         for p in self._filter_hidden(self.path.glob(i)):
             result.add(p.absolute())
     for i in self.exclude:
         for p in self._filter_hidden(self.path.glob(i)):
             result.remove(p.absolute())
     if self.thumbnail_path and all:
         thumbnail = Path(self.path, self.thumbnail_path)
         if thumbnail.exists():
             result.add(thumbnail.absolute())
         else:
             raise Exception('Can not find thumbnail: {}'.format(thumbnail))
     images = [Image(p, e)
               for p, e in read_exif(list(result))] if result else []
     return sorted(images, key=lambda x: getattr(x, self.sortby))
Esempio n. 5
0
    def test_exif_info(self):
        _, exif = read_exif([Path(self.test_img1)])[0]

        self.assertEqual(exif.info(), 'Fujifilm X-T30  XF35mmF2 R WR | ISO320  f/2.0  1/420s | Astia | image-01')