How to use the osxphotos._constants function in osxphotos

To help you get started, we’ve selected a few osxphotos examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RhetTbull / osxphotos / tests / test_movies_5_0.py View on Github external
def test_db_version():
    import osxphotos

    photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
    assert photosdb.db_version in osxphotos._constants._TESTED_DB_VERSIONS
    assert photosdb.db_version == "6000"
github RhetTbull / osxphotos / tests / test_movies_4_0.py View on Github external
def test_db_version():
    import osxphotos

    photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
    assert photosdb.db_version in osxphotos._constants._TESTED_DB_VERSIONS
    assert photosdb.db_version == "4025"
github RhetTbull / photosmeta / photosmeta / __main__.py View on Github external
for album in photo.albums:
            if album not in keywords_raw:
                exif_cmd.append(f"-XMP:TagsList={album}")
                exif_cmd.append(f"-keywords={album}")

    if photo.persons:
        # tmp1 = j[0]["XMP:Subject"] if "XMP:Subject" in j[0] else None
        tmp2 = j[0]["XMP:PersonInImage"] if "XMP:PersonInImage" in j[0] else None
        #        print ("photopath %s tmp1 = '%s' tmp2 = '%s'" % (photopath, tmp1, tmp2))
        # persons_raw = build_list([photo.persons, tmp1, tmp2])
        persons_raw = build_list([photo.persons, tmp2])
        persons_raw = set(persons_raw)

        # Photos 5 identifies all faces even if unknown, remove these
        if osxphotos._constants._UNKNOWN_PERSON in persons_raw:
            persons_raw.remove(osxphotos._constants._UNKNOWN_PERSON)

        for person in persons_raw:
            exif_cmd.append(f"-xmp:PersonInImage={person}")
            # exif_cmd.append(f"-subject={person}")

    # desc = desc or _dbphotos[uuid]["extendedDescription"]
    desc = photo.description
    if desc:
        exif_cmd.append(f"-ImageDescription={desc}")
        exif_cmd.append(f"-xmp:description={desc}")

    # title = name
    title = photo.title
    if title:
        exif_cmd.append(f"-xmp:title={title}")