Example #1
0
    def test_read_exif_tags(self):
        """
        Tests :func:`colour_hdri.utilities.exif.read_exif_tags` definition.
        """

        test_jpg_image = filter_files(FROBISHER_001_DIRECTORY, ('jpg', ))[0]
        exif_data = vivified_to_dict(read_exif_tags(test_jpg_image))

        self.assertIsInstance(exif_data, type(dict()))

        self.assertListEqual(sorted(exif_data.keys()), [
            'Composite', 'EXIF', 'ExifTool', 'File', 'ICC_Profile', 'JFIF',
            'Photoshop', 'XMP'
        ])

        self.assertListEqual(
            sorted(exif_data['EXIF'].values()),
            [[ExifTag('EXIF', 'Camera Model Name', 'EOS 5D Mark II', '272')],
             [ExifTag('EXIF', 'Create Date', '2015:09:19 03:39:20', '36868')],
             [ExifTag('EXIF', 'Date/Time Original',
                      '2015:09:19 03:39:20', '36867')],
             [ExifTag('EXIF', 'Exif Image Height', '426', '40963')],
             [ExifTag('EXIF', 'Exif Image Width', '640', '40962')],
             [ExifTag('EXIF', 'Exposure Time', '0.125', '33434')],
             [ExifTag('EXIF', 'F Number', '8', '33437')],
             [ExifTag('EXIF', 'Focal Length', '16', '37386')],
             [ExifTag('EXIF', 'ISO', '100', '34855')],
             [ExifTag('EXIF', 'Make', 'Canon', '271')],
             [ExifTag('EXIF', 'Modify Date', '2015:09:19 03:39:20', '306')],
             [ExifTag('EXIF', 'Orientation', '1', '274')],
             [ExifTag('EXIF', 'Photometric Interpretation', '2', '262')],
             [ExifTag('EXIF', 'Resolution Unit', '2', '296')],
             [ExifTag('EXIF', 'Software', 'Photos 1.0.1', '305')],
             [ExifTag('EXIF', 'X Resolution', '72', '282')],
             [ExifTag('EXIF', 'Y Resolution', '72', '283')]])  # yapf: disable
Example #2
0
    def test_read_exif_tags(self):
        """
        Tests :func:`colour_hdri.utilities.exif.read_exif_tags` definition.
        """

        test_jpg_image = filter_files(FROBISHER_001_DIRECTORY, ('jpg',))[0]
        exif_data = vivified_to_dict(read_exif_tags(test_jpg_image))

        self.assertIsInstance(exif_data, type(dict()))

        self.assertListEqual(
            sorted(exif_data.keys()),
            ['Composite', 'EXIF', 'ExifTool', 'File', 'ICC_Profile', 'JFIF',
             'Photoshop', 'XMP'])

        self.assertListEqual(
            sorted(exif_data['EXIF'].values()),
            [('0.125', '33434'), ('1', '274'), ('100', '34855'),
             ('16', '37386'), ('2', '262'), ('2', '296'),
             ('2015:09:19 03:39:20', '306'),
             ('2015:09:19 03:39:20', '36867'),
             ('2015:09:19 03:39:20', '36868'), ('426', '40963'),
             ('640', '40962'), ('72', '282'), ('72', '283'),
             ('8', '33437'), ('Canon', '271'), ('EOS 5D Mark II', '272'),
             ('Photos 1.0.1', '305')])
Example #3
0
    def test_vivified_to_dict(self):
        """
        Tests :func:`colour_hdri.utilities.common.vivified_to_dict` definition.
        """

        vivified = vivification()
        vivified['my']['attribute'] = 1
        vivified_as_dict = vivified_to_dict(vivified)
        self.assertIsInstance(dict(), type(vivified_as_dict))
        self.assertIn('attribute', vivified_as_dict['my'].keys())
        self.assertEqual(vivified_as_dict['my']['attribute'], 1)
    def test_vivified_to_dict(self):
        """
        Tests :func:`colour_hdri.utilities.common.vivified_to_dict` definition.
        """

        vivified = vivification()
        vivified['my']['attribute'] = 1
        vivified_as_dict = vivified_to_dict(vivified)
        self.assertIsInstance(dict(), type(vivified_as_dict))
        self.assertIn('attribute', vivified_as_dict['my'].keys())
        self.assertEqual(vivified_as_dict['my']['attribute'], 1)