mirror of
https://github.com/Xevion/phototag.git
synced 2025-12-14 16:12:29 -06:00
formatting, additional logging
This commit is contained in:
@@ -61,16 +61,17 @@ class FileProcessor(object):
|
||||
|
||||
# XMP sidecar file specified, write to it using XML module
|
||||
if self.xmp_name:
|
||||
print('\tWriting {} tags to output XMP...'.format(len(labels)))
|
||||
logging.info('\tWriting {} tags to output XMP.'.format(len(labels)))
|
||||
parser = XMPParser(os.path.join(INPUT_PATH, self.xmp_name))
|
||||
parser.add_keywords(labels)
|
||||
# Save the new XMP file
|
||||
loggin.debug('Saving to new XMP file.')
|
||||
parser.save(os.path.join(OUTPUT_PATH, self.xmp_name))
|
||||
# Remove the old XMP file
|
||||
logging.debug('Removing old XMP file.')
|
||||
os.remove(os.path.join(INPUT_PATH, self.xmp_name))
|
||||
# No XMP file is specified, using IPTC tagging
|
||||
else:
|
||||
print('\tWriting {} tags to output {}'.format(len(labels), self.ext[1:].upper()))
|
||||
logging.info('\tWriting {} tags to image IPTC'.format(len(labels)))
|
||||
info = iptcinfo3.IPTCInfo(os.path.join(INPUT_PATH, self.file_name))
|
||||
info['keywords'].extend(labels)
|
||||
info.save()
|
||||
|
||||
Reference in New Issue
Block a user