Select to view content in your preferred language

metadata thumbnailUri

536
0
03-19-2020 07:39 PM
StellaSpring1
New Contributor

Is there an example of how to update thumbnails using the metadata module? I've tried a number of file path formats including this one below for making a new metadata object. The script runs, but the thumbnail doesn't update.

new_md.thumbnailUri = 'file:///c:/Folder/test.jpg'

Metadata—Metadata module | Documentation 

import arcpyfrom arcpy import metadata as md # Create a new Metadata object and add some content to itnew_md = md.Metadata() new_md.title = 'My Title'new_md.tags = 'Tag1, Tag2'new_md.summary = 'My Summary'new_md.description = 'My Description'new_md.credits = 'My Credits'new_md.accessConstraints = 'My Access Constraints'
# Assign the Metadata object's content to a target itemstreets_path = r'C:\Data\LocalArea.gdb\Streets'tgt_item_md = md.Metadata(streets_path)if not tgt_item_md.isReadOnly:     tgt_item_md.copy(new_md)     tgt_item_md.save()

 
0 Kudos
0 Replies