geopic-tag-reader 1.0.4__py3-none-any.whl → 1.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  """
2
2
  GeoPicTagReader
3
3
  """
4
- __version__ = "1.0.4"
4
+
5
+ __version__ = "1.0.6"
@@ -25,19 +25,25 @@ EQUIRECTANGULAR_MODELS: Dict[str, List[str]] = {
25
25
  }
26
26
 
27
27
 
28
- def is_360(make: Optional[str], model: Optional[str]) -> bool:
28
+ def is_360(make: Optional[str] = None, model: Optional[str] = None, width: Optional[str] = None, height: Optional[str] = None) -> bool:
29
29
  """
30
- Checks if given camera is equirectangular (360°) based on its make and model.
30
+ Checks if given camera is equirectangular (360°) based on its make, model and dimensions (width, height).
31
31
 
32
- >>> is_360(None, None)
32
+ >>> is_360()
33
33
  False
34
- >>> is_360("GoPro", None)
34
+ >>> is_360("GoPro")
35
35
  False
36
36
  >>> is_360("GoPro", "Max 360")
37
37
  True
38
+ >>> is_360("GoPro", "Max 360", "2048", "1024")
39
+ True
40
+ >>> is_360("GoPro", "Max 360", "1024", "768")
41
+ False
38
42
  """
39
43
 
40
44
  if not make or not model:
41
45
  return False
42
46
 
43
- return any(model.startswith(potentialModel) for potentialModel in EQUIRECTANGULAR_MODELS.get(make, []))
47
+ return any(model.startswith(potentialModel) for potentialModel in EQUIRECTANGULAR_MODELS.get(make, [])) and (
48
+ (width is None or height is None) or int(width) == 2 * int(height)
49
+ )
@@ -281,7 +281,7 @@ def readPictureMetadata(picture: bytes) -> GeoPicTags:
281
281
  if isExifTagUsable(data, "Xmp.GPano.ProjectionType"):
282
282
  pic_type = data["Xmp.GPano.ProjectionType"]
283
283
  # 360° based on known models
284
- elif camera.is_360(make, model):
284
+ elif camera.is_360(make, model, data.get("Exif.Photo.PixelXDimension"), data.get("Exif.Photo.PixelYDimension")):
285
285
  pic_type = "equirectangular"
286
286
  # Flat by default
287
287
  else:
@@ -473,7 +473,7 @@ def decodeGPSDateTime(data: dict, group: str) -> Tuple[Optional[datetime.datetim
473
473
 
474
474
  if d is None and isExifTagUsable(data, f"{group}.GPSDateStamp"):
475
475
  try:
476
- dateRaw = data[f"{group}.GPSDateStamp"].replace(":", "-").replace("\x00", "")
476
+ dateRaw = data[f"{group}.GPSDateStamp"].replace(":", "-").replace("\x00", "").replace("/", "-")
477
477
 
478
478
  # Time
479
479
  if isExifTagUsable(data, f"{group}.GPSTimeStamp", List[Fraction]):
@@ -1,22 +1,21 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geopic-tag-reader
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Summary: GeoPicTagReader
5
5
  Author-email: Adrien PAVIE <panieravide@riseup.net>
6
6
  Requires-Python: >=3.8
7
7
  Description-Content-Type: text/markdown
8
8
  Classifier: License :: OSI Approved :: MIT License
9
- Requires-Dist: typer ~= 0.9.0
10
- Requires-Dist: xmltodict ~= 0.13.0
9
+ Requires-Dist: typer ~= 0.12
10
+ Requires-Dist: xmltodict ~= 0.13
11
11
  Requires-Dist: pyexiv2 == 2.8.3
12
12
  Requires-Dist: flit ~= 3.8.0 ; extra == "build"
13
- Requires-Dist: black ~= 22.8.0 ; extra == "dev"
14
- Requires-Dist: mypy ~= 1.0.0 ; extra == "dev"
13
+ Requires-Dist: black ~= 24.3 ; extra == "dev"
14
+ Requires-Dist: mypy ~= 1.9 ; extra == "dev"
15
15
  Requires-Dist: pytest ~= 7.2.0 ; extra == "dev"
16
- Requires-Dist: pytest-datafiles ~= 2.0.1 ; extra == "dev"
17
- Requires-Dist: typer-cli-forked ~= 0.0.14 ; extra == "dev"
16
+ Requires-Dist: pytest-datafiles ~= 3.0 ; extra == "dev"
18
17
  Requires-Dist: lazydocs ~= 0.4.8 ; extra == "dev"
19
- Requires-Dist: types-xmltodict ~= 0.13.0 ; extra == "dev"
18
+ Requires-Dist: types-xmltodict ~= 0.13 ; extra == "dev"
20
19
  Requires-Dist: pre-commit ~= 3.3.3 ; extra == "dev"
21
20
  Requires-Dist: timezonefinder == 6.2.0 ; extra == "write-exif"
22
21
  Requires-Dist: pytz ~= 2023.3 ; extra == "write-exif"
@@ -0,0 +1,12 @@
1
+ geopic_tag_reader/__init__.py,sha256=AB9t1irfcb0A7j8MHsCnqxKwAll8VkwJKfgEAPE4Jw4,47
2
+ geopic_tag_reader/camera.py,sha256=2Sr0jAt3RXUWazYMnkwF6J6lVnKvSp7Ac8g7yOHehVA,1643
3
+ geopic_tag_reader/main.py,sha256=LohJW0xX0A8DAbcUR_BnJ2UvN4qo6yydzOGtq3zIArA,3129
4
+ geopic_tag_reader/model.py,sha256=rsWVE3T1kpNsKXX8iv6xb_3PCVY6Ea7iU9WOqUgXklU,129
5
+ geopic_tag_reader/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ geopic_tag_reader/reader.py,sha256=PK1mN7TFFC8V70-pU_EM6cTESNcAed1GydHWUkqkT3A,21325
7
+ geopic_tag_reader/writer.py,sha256=L13ewadZhZic13k66FsQvqGQ_s512nssKvvSwZp4Ggg,8680
8
+ geopic_tag_reader-1.0.6.dist-info/entry_points.txt,sha256=c9YwjCNhxveDf-61_aSRlzcpoutvM6KQCerlzaVt_JU,64
9
+ geopic_tag_reader-1.0.6.dist-info/LICENSE,sha256=oHWDwXkJJb9zJzThMN3F9Li4yFhz1qxOUByouY7L3bI,1070
10
+ geopic_tag_reader-1.0.6.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
11
+ geopic_tag_reader-1.0.6.dist-info/METADATA,sha256=US7A6UqzLzwlLvtCiHWPQszwLTNtNt_Pzka6DLJBbmg,6375
12
+ geopic_tag_reader-1.0.6.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- geopic_tag_reader/__init__.py,sha256=bH9bSIKTRmkGaoNiRbBRpdRBGwnd87d6eDd3fTBNF2U,46
2
- geopic_tag_reader/camera.py,sha256=hhQRhMU_UIhkLZ0LF1800OOlX4q92AZm8saMSjeMzic,1351
3
- geopic_tag_reader/main.py,sha256=LohJW0xX0A8DAbcUR_BnJ2UvN4qo6yydzOGtq3zIArA,3129
4
- geopic_tag_reader/model.py,sha256=rsWVE3T1kpNsKXX8iv6xb_3PCVY6Ea7iU9WOqUgXklU,129
5
- geopic_tag_reader/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- geopic_tag_reader/reader.py,sha256=3b929DF4ArjRhsJFhvp_ebpWgNXSNvoEeYSEQ8PxFRk,21227
7
- geopic_tag_reader/writer.py,sha256=L13ewadZhZic13k66FsQvqGQ_s512nssKvvSwZp4Ggg,8680
8
- geopic_tag_reader-1.0.4.dist-info/entry_points.txt,sha256=c9YwjCNhxveDf-61_aSRlzcpoutvM6KQCerlzaVt_JU,64
9
- geopic_tag_reader-1.0.4.dist-info/LICENSE,sha256=oHWDwXkJJb9zJzThMN3F9Li4yFhz1qxOUByouY7L3bI,1070
10
- geopic_tag_reader-1.0.4.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
11
- geopic_tag_reader-1.0.4.dist-info/METADATA,sha256=sQgQ9-yn-TutQua0vOGHg0OXQ-mTe0X7kNur1qsbD1o,6445
12
- geopic_tag_reader-1.0.4.dist-info/RECORD,,