def testSetAttributes(self): method_name = sys._getframe(0).f_code.co_name print "**** %s ****" % method_name #fn =r"/Users/luiscberrocal/Pictures/IMG_3109.JPG" nfn = backupFile(self.fn) extool = ExifTool(nfn, False) title = u"XMP Title set on %s" % (datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) print nfn print "-" * len(nfn) extool.setAttributes("xmp",{"Title": title}) extool.prettyPrint("xmp") #print extool.getAttribute("xmp:Title") self.assertEquals(title, extool.getAttribute("xmp:Title"))
def test_WriteToXMP_JPG(self): method_name = sys._getframe(0).f_code.co_name print "**** %s ****" % method_name fn = self.data['ferns'] backup_folder = TestConfig.getInstance().output_path backup_file = backupFile(fn, outputPath=backup_folder, overwrite=True) print backup_file ex = ExifTool(backup_file, False) now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') ex.setAttributes("exif", {"DateTimeOriginal": now}) dates = ex.getDateAttributes() for k, v in dates.iteritems(): print "%40s = %s" % (k, v)