def setTitle(p_filename, p_setTitleToThis): """ :param p_filename: name/path of the file :type p_filename: string :param p_setTitleToThis: title we will store as title metadata :type p_setTitleToThis: string :return: True if operation was successful :rtype: bool """ if p_setTitleToThis == "": try: MetadataManagerL0.wipeTitle(p_filename) except Exception as e: print("MetadataManager2.setTitle() error: ", e) return False else: try: MetadataManagerL0.setTitle(p_filename, p_setTitleToThis) except Exception as e: print("MetadataManager2.setTitle() error: ", e) return False try: MetadataManagerL1.placeMark(p_filename) return True except Exception as e: print("MetadataManager2.setTitle() Mark error: ", e) return False
def tryAddData(p_filename): #this will try to add every kind of metadata possible to an image. #-------------Title-------------------------------------- MetadataManagerL0.setTitle(p_filename, "testFile") # -------------Tags-------------------------------------- MetadataManagerL1.addArtist(p_filename, "creator: weirdo") # -------------Artist------------------------------------ MetadataManagerL1.addTag(p_filename, "test") # -------------Description------------------------------- MetadataManagerL0.setDescr(p_filename, "this is a sample description") # -------------Rating------------------------------------ MetadataManagerL0.setRating(p_filename, 3) return