Logo Search packages:      
Sourcecode: lazygal version File versions  Download package

def lazygal::metadata::ExifTags::get_camera_name (   self )
Gets vendor and model name from EXIF and tries to construct
camera name out of this. This is a bit fuzzy, because diferent
vendors put different information to both tags.

Definition at line 80 of file metadata.py.

                             :
        '''
        Gets vendor and model name from EXIF and tries to construct
        camera name out of this. This is a bit fuzzy, because diferent
        vendors put different information to both tags.
        '''
        try:
            model = str(self['Exif.Image.Model'])
            try:
                vendor = str(self['Exif.Image.Make'])
                vendor_l = vendor.lower()
                model_l = model.lower()
                # Split vendor to words and check whether they are
                # already in model, for example:
                # Canon/Canon A40
                # PENTAX Corporation/PENTAX K10D
                # Eastman Kodak Company/KODAK DIGITAL SCIENCE DC260 (V01.00)
                for word in vendor_l.split(' '):
                    if model_l.find(word) != -1:
                        return model
                return '%s %s' % (vendor, model)
            except KeyError:
                return model
        except KeyError:
            return ''


Generated by  Doxygen 1.6.0   Back to index