Exemplo n.º 1
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
Exemplo n.º 2
0
def setRating(p_filename, p_setRatingToThis):
    """
    :param p_filename: name/path of the file
	:type p_filename: string
	:param p_setRatingToThis: rating metadata will be set to this
	:type p_setRatingToThis: int

	:return: True if operation was successful
    :rtype: bool
    """
    try:
        MetadataManagerL0.setRating(p_filename, p_setRatingToThis)
    except Exception as e:
        print("MetadataManager2.setRating() error: ", e)
        return False
    try:
        MetadataManagerL1.placeMark(p_filename)
        return True
    except Exception as e:
        print("MetadataManager2.setRating() Mark error: ", e)
        return True