Ejemplo n.º 1
0
    def create_meta(self):
        '''Parse and instantiate video metadata.'''
        self.metadata = Meta(self)

        # Extracting EXIF metadata.
        exif = get_exif(self.filepath)
        # Extracting data.
        self.metadata.date = get_date(exif)
        self.metadata.dictionary['date'] = self.metadata.date
        # Extracting geolocation.
        self.metadata.gps = get_gps(exif)
        self.metadata.dictionary['geolocation'] = self.metadata.gps[
            'geolocation']
        self.metadata.dictionary['latitude'] = self.metadata.gps['latitude']
        self.metadata.dictionary['longitude'] = self.metadata.gps['longitude']

        # Extracts duration, dimensions and video codec.
        infos = get_info(self.filepath)
        self.metadata.dictionary['duration'] = infos['duration']
        self.metadata.dictionary['dimensions'] = infos['dimensions']
        self.metadata.dictionary['codec'] = infos['codec']

        print
        print '\tVariable\tMetadata'
        print '\t' + 40 * '-'
        print '\t' + self.filepath
        print '\t' + 40 * '-'
        print '\tTitle:\t\t%s' % self.metadata.title
        print '\tCaption:\t%s' % self.metadata.caption
        print '\tTaxon:\t\t%s' % ', '.join(self.metadata.taxon)
        print '\tTags:\t\t%s' % '\n\t\t\t'.join(self.metadata.tags)
        print '\tSize:\t\t%s' % self.metadata.size
        print '\tSource:\t%s' % ', '.join(self.metadata.source)
        print '\tAuthor:\t\t%s' % ', '.join(self.metadata.author)
        print '\tSublocation:\t%s' % self.metadata.sublocation
        print '\tCity:\t\t%s' % self.metadata.city
        print '\tState:\t\t%s' % self.metadata.state
        print '\tCountry:\t%s' % self.metadata.country
        print '\tRights:\t\t%s' % self.metadata.rights
        print '\tDate:\t\t%s' % self.metadata.date
        print
        print '\tGeolocation:\t%s' % self.metadata.gps['geolocation'].decode(
            "utf8")
        print '\tDecimal:\t%s, %s' % (self.metadata.gps['latitude'],
                                      self.metadata.gps['longitude'])
        print
Ejemplo n.º 2
0
    def create_meta(self):
        '''Parse and instantiate video metadata.'''
        self.metadata = Meta(self)

        # Extracting EXIF metadata.
        exif = get_exif(self.filepath)
        # Extracting data.
        self.metadata.date = get_date(exif)
        self.metadata.dictionary['date'] = self.metadata.date
        # Extracting geolocation.
        self.metadata.gps = get_gps(exif)
        self.metadata.dictionary['geolocation'] = self.metadata.gps['geolocation']
        self.metadata.dictionary['latitude'] = self.metadata.gps['latitude']
        self.metadata.dictionary['longitude'] = self.metadata.gps['longitude']

        # Extracts duration, dimensions and video codec.
        infos = get_info(self.filepath)
        self.metadata.dictionary['duration'] = infos['duration']
        self.metadata.dictionary['dimensions'] = infos['dimensions']
        self.metadata.dictionary['codec'] = infos['codec']

        print
        print '\tVariable\tMetadata'
        print '\t' + 40 * '-'
        print '\t' + self.filepath
        print '\t' + 40 * '-'
        print '\tTitle:\t\t%s' % self.metadata.title
        print '\tCaption:\t%s' % self.metadata.caption
        print '\tTaxon:\t\t%s' % ', '.join(self.metadata.taxon)
        print '\tTags:\t\t%s' % '\n\t\t\t'.join(self.metadata.tags)
        print '\tSize:\t\t%s' % self.metadata.size
        print '\tSource:\t%s' % ', '.join(self.metadata.source)
        print '\tAuthor:\t\t%s' % ', '.join(self.metadata.author)
        print '\tSublocation:\t%s' % self.metadata.sublocation
        print '\tCity:\t\t%s' % self.metadata.city
        print '\tState:\t\t%s' % self.metadata.state
        print '\tCountry:\t%s' % self.metadata.country
        print '\tRights:\t\t%s' % self.metadata.rights
        print '\tDate:\t\t%s' % self.metadata.date
        print
        print '\tGeolocation:\t%s' % self.metadata.gps['geolocation'].decode("utf8")
        print '\tDecimal:\t%s, %s' % (self.metadata.gps['latitude'],
                self.metadata.gps['longitude'])
        print
Ejemplo n.º 3
0
    def create_meta(self):
        '''Parse and instantiate photo metadata.

        Uses iptcinfo.py and pyexiv2 libraries for IPTC and EXIF.
        '''
        self.metadata = Meta(self)

        # Extracting EXIF metadata.
        exif = get_exif(self.filepath)
        # Extracting data.
        self.metadata.date = get_date(exif)
        self.metadata.dictionary['date'] = self.metadata.date
        # Extracting geolocation.
        self.metadata.gps = get_gps(exif)
        self.metadata.dictionary['geolocation'] = self.metadata.gps[
            'geolocation']
        self.metadata.dictionary['latitude'] = self.metadata.gps['latitude']
        self.metadata.dictionary['longitude'] = self.metadata.gps['longitude']

        print
        print '\tVariable\tMetadata'
        print '\t' + 40 * '-'
        print '\t' + self.filepath
        print '\t' + 40 * '-'
        print '\tTitle:\t\t%s' % self.metadata.title
        print '\tCaption:\t%s' % self.metadata.caption
        print '\tTaxon:\t\t%s' % ', '.join(self.metadata.taxon)
        print '\tTags:\t\t%s' % '\n\t\t\t'.join(self.metadata.tags)
        print '\tSize:\t\t%s' % self.metadata.size
        print '\tSource:\t%s' % ', '.join(self.metadata.source)
        print '\tAuthor:\t\t%s' % ', '.join(self.metadata.author)
        print '\tSublocation:\t%s' % self.metadata.sublocation
        print '\tCity:\t\t%s' % self.metadata.city
        print '\tState:\t\t%s' % self.metadata.state
        print '\tCountry:\t%s' % self.metadata.country
        print '\tRights:\t\t%s' % self.metadata.rights
        print '\tDate:\t\t%s' % self.metadata.date
        print
        print '\tGeolocation:\t%s' % self.metadata.gps['geolocation'].decode(
            "utf8")
        print '\tDecimal:\t%s, %s' % (self.metadata.gps['latitude'],
                                      self.metadata.gps['longitude'])
        print
Ejemplo n.º 4
0
    def create_meta(self):
        '''Parse and instantiate photo metadata.

        Uses iptcinfo.py and pyexiv2 libraries for IPTC and EXIF.
        '''
        self.metadata = Meta(self)

        # Extracting EXIF metadata.
        exif = get_exif(self.filepath)
        # Extracting data.
        self.metadata.date = get_date(exif)
        self.metadata.dictionary['date'] = self.metadata.date
        # Extracting geolocation.
        self.metadata.gps = get_gps(exif)
        self.metadata.dictionary['geolocation'] = self.metadata.gps['geolocation']
        self.metadata.dictionary['latitude'] = self.metadata.gps['latitude']
        self.metadata.dictionary['longitude'] = self.metadata.gps['longitude']

        print
        print '\tVariable\tMetadata'
        print '\t' + 40 * '-'
        print '\t' + self.filepath
        print '\t' + 40 * '-'
        print '\tTitle:\t\t%s' % self.metadata.title
        print '\tCaption:\t%s' % self.metadata.caption
        print '\tTaxon:\t\t%s' % ', '.join(self.metadata.taxon)
        print '\tTags:\t\t%s' % '\n\t\t\t'.join(self.metadata.tags)
        print '\tSize:\t\t%s' % self.metadata.size
        print '\tSource:\t%s' % ', '.join(self.metadata.source)
        print '\tAuthor:\t\t%s' % ', '.join(self.metadata.author)
        print '\tSublocation:\t%s' % self.metadata.sublocation
        print '\tCity:\t\t%s' % self.metadata.city
        print '\tState:\t\t%s' % self.metadata.state
        print '\tCountry:\t%s' % self.metadata.country
        print '\tRights:\t\t%s' % self.metadata.rights
        print '\tDate:\t\t%s' % self.metadata.date
        print
        print '\tGeolocation:\t%s' % self.metadata.gps['geolocation'].decode("utf8")
        print '\tDecimal:\t%s, %s' % (self.metadata.gps['latitude'],
                self.metadata.gps['longitude'])
        print