Beispiel #1
0
def setDescr(p_filename, p_setDescrToThis):
    """
    :param p_filename: name/path of the file
	:type p_filename: string
	:param p_setDescrToThis: description metadata will be set to this
	:type p_setDescrToThis: string

	:return: True if operation was successful
    :rtype: bool
    """
    if p_setDescrToThis == "":
        try:
            MetadataManagerL0.wipeDescr(p_filename)
        except Exception as e:
            print("MetadataManager2.setDescr() error: ", e)
            return False
    else:
        try:
            MetadataManagerL0.setDescr(p_filename, p_setDescrToThis)
        except Exception as e:
            print("MetadataManager2.setDescr() error: ", e)
            return False
    try:
        MetadataManagerL1.placeMark(p_filename)
        return True
    except Exception as e:
        print("MetadataManager2.setDescr() Mark error: ", e)
        return False
Beispiel #2
0
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