Fix for issue #237
This commit is contained in:
parent
a960468887
commit
a416de29e4
@ -1,4 +1,4 @@
|
||||
""" version info """
|
||||
|
||||
__version__ = "0.35.4"
|
||||
__version__ = "0.35.5"
|
||||
|
||||
|
||||
@ -1127,11 +1127,10 @@ def _exiftool_json_sidecar(
|
||||
|
||||
(lat, lon) = self.location
|
||||
if lat is not None and lon is not None:
|
||||
lat_str, lon_str = dd_to_dms_str(lat, lon)
|
||||
exif["EXIF:GPSLatitude"] = lat_str
|
||||
exif["EXIF:GPSLongitude"] = lon_str
|
||||
lat_ref = "North" if lat >= 0 else "South"
|
||||
lon_ref = "East" if lon >= 0 else "West"
|
||||
exif["EXIF:GPSLatitude"] = lat
|
||||
exif["EXIF:GPSLongitude"] = lon
|
||||
lat_ref = "N" if lat >= 0 else "S"
|
||||
lon_ref = "E" if lon >= 0 else "W"
|
||||
exif["EXIF:GPSLatitudeRef"] = lat_ref
|
||||
exif["EXIF:GPSLongitudeRef"] = lon_ref
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -7,7 +7,7 @@
|
||||
<key>hostuuid</key>
|
||||
<string>9575E48B-8D5F-5654-ABAC-4431B1167324</string>
|
||||
<key>pid</key>
|
||||
<integer>40469</integer>
|
||||
<integer>36387</integer>
|
||||
<key>processname</key>
|
||||
<string>photolibraryd</string>
|
||||
<key>uid</key>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -315,6 +315,10 @@ CLI_EXIFTOOL = {
|
||||
"XMP:Description": "Girl holding pumpkin",
|
||||
"XMP:PersonInImage": "Katie",
|
||||
"XMP:Subject": ["Kids", "Katie"],
|
||||
"EXIF:GPSLatitudeRef": "N",
|
||||
"EXIF:GPSLongitudeRef": "W",
|
||||
"EXIF:GPSLatitude": 41.256566,
|
||||
"EXIF:GPSLongitude": 95.940257,
|
||||
}
|
||||
}
|
||||
|
||||
@ -819,7 +823,6 @@ def test_export_exiftool():
|
||||
import glob
|
||||
import os
|
||||
import os.path
|
||||
import osxphotos
|
||||
from osxphotos.__main__ import export
|
||||
from osxphotos.exiftool import ExifTool
|
||||
|
||||
@ -831,7 +834,7 @@ def test_export_exiftool():
|
||||
result = runner.invoke(
|
||||
export,
|
||||
[
|
||||
os.path.join(cwd, PHOTOS_DB_15_4),
|
||||
os.path.join(cwd, PHOTOS_DB_15_6),
|
||||
".",
|
||||
"-V",
|
||||
"--exiftool",
|
||||
|
||||
@ -66,6 +66,18 @@ UUID_DICT = {
|
||||
XMP_FILENAME = "Pumkins1.jpg.xmp"
|
||||
XMP_JPG_FILENAME = "Pumkins1.jpg"
|
||||
|
||||
EXIF_JSON_EXPECTED = (
|
||||
'[{"_CreatedBy": "osxphotos, https://github.com/RhetTbull/osxphotos", '
|
||||
'"XMP:Title": "St. James\'s Park", "XMP:TagsList": ["UK", "England", '
|
||||
'"London", "United Kingdom", "London 2018", "St. James\'s Park"], '
|
||||
'"IPTC:Keywords": ["UK", "England", "London", "United Kingdom", "London 2018", '
|
||||
'"St. James\'s Park"], "XMP:Subject": ["UK", "England", "London", "United Kingdom", '
|
||||
'"London 2018", "St. James\'s Park"], "EXIF:GPSLatitude": 51.50357167, '
|
||||
'"EXIF:GPSLongitude": -0.1318055, "EXIF:GPSLatitudeRef": "N", '
|
||||
'"EXIF:GPSLongitudeRef": "W", "EXIF:DateTimeOriginal": "2018:10:13 09:18:12", '
|
||||
'"EXIF:OffsetTimeOriginal": "-04:00", "EXIF:ModifyDate": "2019:12:08 14:06:44"}]'
|
||||
)
|
||||
|
||||
|
||||
def test_export_1():
|
||||
# test basic export
|
||||
@ -456,21 +468,7 @@ def test_exiftool_json_sidecar():
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["location"]])
|
||||
|
||||
json_expected = json.loads(
|
||||
"""
|
||||
[{"XMP:Title": "St. James\'s Park",
|
||||
"XMP:TagsList": ["London 2018", "St. James\'s Park", "England", "United Kingdom", "UK", "London"],
|
||||
"IPTC:Keywords": ["London 2018", "St. James\'s Park", "England", "United Kingdom", "UK", "London"],
|
||||
"XMP:Subject": ["London 2018", "St. James\'s Park", "England", "United Kingdom", "UK", "London"],
|
||||
"EXIF:GPSLatitude": "51 deg 30\' 12.86\\" N",
|
||||
"EXIF:GPSLongitude": "0 deg 7\' 54.50\\" W",
|
||||
"EXIF:GPSLatitudeRef": "North", "EXIF:GPSLongitudeRef": "West",
|
||||
"EXIF:DateTimeOriginal": "2018:10:13 09:18:12",
|
||||
"EXIF:OffsetTimeOriginal": "-04:00",
|
||||
"EXIF:ModifyDate": "2019:12:08 14:06:44",
|
||||
"_CreatedBy": "osxphotos, https://github.com/RhetTbull/osxphotos"
|
||||
}] """
|
||||
)[0]
|
||||
json_expected = json.loads(EXIF_JSON_EXPECTED)[0]
|
||||
|
||||
json_got = photos[0]._exiftool_json_sidecar()
|
||||
json_got = json.loads(json_got)[0]
|
||||
|
||||
@ -45,6 +45,18 @@ UUID_DICT = {
|
||||
"xmp": "8SOE9s0XQVGsuq4ONohTng",
|
||||
}
|
||||
|
||||
EXIF_JSON_EXPECTED = (
|
||||
'[{"_CreatedBy": "osxphotos, https://github.com/RhetTbull/osxphotos", '
|
||||
'"XMP:Title": "St. James\'s Park", "XMP:TagsList": ["UK", "England", '
|
||||
'"London", "United Kingdom", "London 2018", "St. James\'s Park"], '
|
||||
'"IPTC:Keywords": ["UK", "England", "London", "United Kingdom", "London 2018", '
|
||||
'"St. James\'s Park"], "XMP:Subject": ["UK", "England", "London", "United Kingdom", '
|
||||
'"London 2018", "St. James\'s Park"], "EXIF:GPSLatitude": 51.50357167, '
|
||||
'"EXIF:GPSLongitude": -0.1318055, "EXIF:GPSLatitudeRef": "N", '
|
||||
'"EXIF:GPSLongitudeRef": "W", "EXIF:DateTimeOriginal": "2018:10:13 09:18:12", '
|
||||
'"EXIF:OffsetTimeOriginal": "-04:00", "EXIF:ModifyDate": "2019:12:01 11:43:45"}]'
|
||||
)
|
||||
|
||||
|
||||
def test_export_1():
|
||||
# test basic export
|
||||
@ -372,21 +384,7 @@ def test_exiftool_json_sidecar():
|
||||
photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB)
|
||||
photos = photosdb.photos(uuid=[UUID_DICT["location"]])
|
||||
|
||||
json_expected = json.loads(
|
||||
"""
|
||||
[{"XMP:Title": "St. James\'s Park",
|
||||
"XMP:TagsList": ["London 2018", "St. James\'s Park", "England", "United Kingdom", "UK", "London"],
|
||||
"IPTC:Keywords": ["London 2018", "St. James\'s Park", "England", "United Kingdom", "UK", "London"],
|
||||
"XMP:Subject": ["London 2018", "St. James\'s Park", "England", "United Kingdom", "UK", "London"],
|
||||
"EXIF:GPSLatitude": "51 deg 30\' 12.86\\" N",
|
||||
"EXIF:GPSLongitude": "0 deg 7\' 54.50\\" W",
|
||||
"EXIF:GPSLatitudeRef": "North", "EXIF:GPSLongitudeRef": "West",
|
||||
"EXIF:DateTimeOriginal": "2018:10:13 09:18:12",
|
||||
"EXIF:OffsetTimeOriginal": "-04:00",
|
||||
"EXIF:ModifyDate": "2019:12:01 11:43:45",
|
||||
"_CreatedBy": "osxphotos, https://github.com/RhetTbull/osxphotos"
|
||||
}] """
|
||||
)[0]
|
||||
json_expected = json.loads(EXIF_JSON_EXPECTED)[0]
|
||||
|
||||
json_got = photos[0]._exiftool_json_sidecar()
|
||||
json_got = json.loads(json_got)[0]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user