geopic-tag-reader 1.4.1__py3-none-any.whl → 1.4.2__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.
@@ -2,4 +2,4 @@
2
2
  GeoPicTagReader
3
3
  """
4
4
 
5
- __version__ = "1.4.1"
5
+ __version__ = "1.4.2"
@@ -50,6 +50,29 @@ class Picture:
50
50
  distance = R * c
51
51
  return distance
52
52
 
53
+ def rotation_angle(self, other) -> Optional[float]:
54
+ return rotation_angle(self.metadata.heading, other.metadata.heading)
55
+
56
+
57
+ def rotation_angle(heading1: Optional[int], heading2: Optional[int]) -> Optional[int]:
58
+ """Computes relative heading between two headings
59
+
60
+ >>> rotation_angle(120, 120)
61
+ 0
62
+ >>> rotation_angle(120, 240)
63
+ 120
64
+ >>> rotation_angle(15, 335)
65
+ 40
66
+ >>> rotation_angle(335, 15)
67
+ 40
68
+ >>> rotation_angle(None, 15)
69
+
70
+ """
71
+ if heading1 is None or heading2 is None:
72
+ return None
73
+ diff = (heading1 - heading2) % 360
74
+ return min(diff, 360 - diff)
75
+
53
76
 
54
77
  class SplitReason(str, Enum):
55
78
  time = "time"
@@ -212,21 +235,19 @@ def find_duplicates(pictures: List[Picture], params: Optional[MergeParams] = Non
212
235
  nonDups.append(currentPic)
213
236
  continue
214
237
 
238
+ is_duplicate = False
239
+
215
240
  # Compare distance
216
241
  dist = prevPic.distance_to(currentPic)
217
242
 
218
- if dist <= params.maxDistance: # type: ignore
243
+ if params.maxDistance is not None and dist <= params.maxDistance:
219
244
  # Compare angle (if available on both images)
220
- if params.maxRotationAngle is not None and prevPic.metadata.heading is not None and currentPic.metadata.heading is not None:
221
- deltaAngle = abs(currentPic.metadata.heading - prevPic.metadata.heading)
222
-
223
- if deltaAngle <= params.maxRotationAngle:
224
- dups.append(currentPic)
225
- else:
226
- lastNonDuplicatedPicId = i
227
- nonDups.append(currentPic)
228
- else:
229
- dups.append(currentPic)
245
+ angle = prevPic.rotation_angle(currentPic)
246
+ if angle is None or params.maxRotationAngle is None or angle <= params.maxRotationAngle:
247
+ is_duplicate = True
248
+
249
+ if is_duplicate:
250
+ dups.append(currentPic)
230
251
  else:
231
252
  lastNonDuplicatedPicId = i
232
253
  nonDups.append(currentPic)
@@ -7,8 +7,8 @@ msgid ""
7
7
  msgstr ""
8
8
  "Project-Id-Version: PACKAGE VERSION\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
- "POT-Creation-Date: 2025-02-03 14:04+0100\n"
11
- "PO-Revision-Date: 2025-02-03 14:04+0100\n"
10
+ "POT-Creation-Date: 2025-02-10 11:04+0100\n"
11
+ "PO-Revision-Date: 2025-02-10 11:04+0100\n"
12
12
  "Last-Translator: Automatically generated\n"
13
13
  "Language-Team: none\n"
14
14
  "Language: en\n"
@@ -8,7 +8,7 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2025-02-03 14:04+0100\n"
11
+ "POT-Creation-Date: 2025-02-10 11:04+0100\n"
12
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: geopic-tag-reader
3
- Version: 1.4.1
3
+ Version: 1.4.2
4
4
  Summary: GeoPicTagReader
5
5
  Author-email: Adrien PAVIE <panieravide@riseup.net>
6
6
  Requires-Python: >=3.8
@@ -1,4 +1,4 @@
1
- geopic_tag_reader/__init__.py,sha256=c207yJughXGK1Geiv-VN-gE9vE98ljuh3fLvoZXl140,47
1
+ geopic_tag_reader/__init__.py,sha256=N92-AzYKKUkUHQxQeY5xLVd_xDvHF1DYYG0JfR4rz9s,47
2
2
  geopic_tag_reader/camera.py,sha256=PBLyM_f9_wfv7kcFRm-7rBrrB99IibjhTPiokwskYGQ,4136
3
3
  geopic_tag_reader/cameras.csv,sha256=F_cE45CY4ocEsWb_9WfgGkumJzmspiK4ZL2LURgbigc,120406
4
4
  geopic_tag_reader/i18n.py,sha256=LOLBj7eB_hpHTc5XdMP97EoWdD2kgmkP_uvJJDKEVsU,342
@@ -6,15 +6,15 @@ geopic_tag_reader/main.py,sha256=xeEXMq-fFu0CtUiAgAeS9mb872D65OAQup3UeF6w050,403
6
6
  geopic_tag_reader/model.py,sha256=rsWVE3T1kpNsKXX8iv6xb_3PCVY6Ea7iU9WOqUgXklU,129
7
7
  geopic_tag_reader/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  geopic_tag_reader/reader.py,sha256=6BNvBEZOWDjFPi-jCaDuL_yGRB8fXSp31ikml_nUM6k,31842
9
- geopic_tag_reader/sequence.py,sha256=5jQKnYDVQq4VDa09e8xTW9Gf-CvqsijEtx5OCSnvGMU,11180
9
+ geopic_tag_reader/sequence.py,sha256=ybHLIZyRWEw0I-sO6DDeXq8p9o1diuvRYyxmZwRVQoo,11595
10
10
  geopic_tag_reader/writer.py,sha256=HdZenoY_5Qv1Kq0jedCJhVFDYsv0iQaCzB6necU_LrY,8793
11
- geopic_tag_reader/translations/geopic_tag_reader.pot,sha256=vATNccMqU2jZ9gkrdK4Y-IvIgGwQUa2TcCbld-Zi8IM,4622
11
+ geopic_tag_reader/translations/geopic_tag_reader.pot,sha256=cnKqknkWlVx3apGCtchh3NbKjbYdowC5577L2clDAHk,4622
12
12
  geopic_tag_reader/translations/da/LC_MESSAGES/geopic_tag_reader.mo,sha256=AdDcKqSs1t1RaN7toVGQvFVsTvgqx5FAhTnT0-MsdTA,4855
13
13
  geopic_tag_reader/translations/da/LC_MESSAGES/geopic_tag_reader.po,sha256=5rxRuYVVqVhfNwYa8X2hPX6BO5Qsgl78OLLWUU5bdRw,6635
14
14
  geopic_tag_reader/translations/de/LC_MESSAGES/geopic_tag_reader.mo,sha256=ZR8Oei98aHfeFtFvPQ_R5LkiybdO8VZ1zKf07y8hCRk,5104
15
15
  geopic_tag_reader/translations/de/LC_MESSAGES/geopic_tag_reader.po,sha256=xd37XFYDMHCwhvBFYhVSfNAc22tuym9rW9IJ2yTEjFk,6918
16
- geopic_tag_reader/translations/en/LC_MESSAGES/geopic_tag_reader.mo,sha256=0pDCjKAenaVQ2fVZXDq2C4BvMmkof60smKkdcvechow,4504
17
- geopic_tag_reader/translations/en/LC_MESSAGES/geopic_tag_reader.po,sha256=yKCQTKTyxNWYwraR72EI0pxV959qUtPKfcxxzJ_X1Vs,6289
16
+ geopic_tag_reader/translations/en/LC_MESSAGES/geopic_tag_reader.mo,sha256=om08-vzA74kcVq6sHqZq7n9r2ENdj7_g_yOzp6N0wqA,4504
17
+ geopic_tag_reader/translations/en/LC_MESSAGES/geopic_tag_reader.po,sha256=uzkEXaovdrV9VWevwr4n6wEf-ZhJqLxmdUikhfo3Cng,6289
18
18
  geopic_tag_reader/translations/eo/LC_MESSAGES/geopic_tag_reader.mo,sha256=07EPHLmZWEcaQJ77yQs4kw929D6q74HHIhJcxHBMX-o,4860
19
19
  geopic_tag_reader/translations/eo/LC_MESSAGES/geopic_tag_reader.po,sha256=qWFtKuS0qHQOzBegXQycuHxH-ghAou3-eiL_UZ85bXo,6634
20
20
  geopic_tag_reader/translations/es/LC_MESSAGES/geopic_tag_reader.mo,sha256=MXMSCqwwP6HEs8R2NuLPA3YBENij2dK8jSsTExPeOrI,3883
@@ -37,8 +37,8 @@ geopic_tag_reader/translations/pl/LC_MESSAGES/geopic_tag_reader.mo,sha256=M3yThM
37
37
  geopic_tag_reader/translations/pl/LC_MESSAGES/geopic_tag_reader.po,sha256=v_bCCSYZ4mQZsVcItz8fO12m9X9f_PxdoMj4hwIcgpY,6384
38
38
  geopic_tag_reader/translations/zh_Hant/LC_MESSAGES/geopic_tag_reader.mo,sha256=6bKHZnihlDOQQ5IQMKIgWViL5BorECqJ2ERFkE4LC6s,326
39
39
  geopic_tag_reader/translations/zh_Hant/LC_MESSAGES/geopic_tag_reader.po,sha256=QIiHRmrEHny4njQPBsj07fqtK2QFTgrAFc-E3s7ddJU,4600
40
- geopic_tag_reader-1.4.1.dist-info/entry_points.txt,sha256=c9YwjCNhxveDf-61_aSRlzcpoutvM6KQCerlzaVt_JU,64
41
- geopic_tag_reader-1.4.1.dist-info/LICENSE,sha256=OCZiFd7ok-n5jly2LwP7hEjuUukkvSt5iMkK_cY_00o,1076
42
- geopic_tag_reader-1.4.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
43
- geopic_tag_reader-1.4.1.dist-info/METADATA,sha256=RYQn5vhNvc_vlZyomQvpfttYvmwSGiEABTyk5b0YPCw,4617
44
- geopic_tag_reader-1.4.1.dist-info/RECORD,,
40
+ geopic_tag_reader-1.4.2.dist-info/entry_points.txt,sha256=c9YwjCNhxveDf-61_aSRlzcpoutvM6KQCerlzaVt_JU,64
41
+ geopic_tag_reader-1.4.2.dist-info/LICENSE,sha256=OCZiFd7ok-n5jly2LwP7hEjuUukkvSt5iMkK_cY_00o,1076
42
+ geopic_tag_reader-1.4.2.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
43
+ geopic_tag_reader-1.4.2.dist-info/METADATA,sha256=Rjq9t0DklfK2vIMg-87oOO7N7tPWgRXNSpVRe7R6SiE,4617
44
+ geopic_tag_reader-1.4.2.dist-info/RECORD,,