geopic-tag-reader 1.1.0__tar.gz → 1.1.2__tar.gz
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.
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/.gitignore +2 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/.gitlab-ci.yml +2 -1
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/CHANGELOG.md +42 -23
- geopic_tag_reader-1.1.2/Makefile +37 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/PKG-INFO +12 -39
- geopic_tag_reader-1.1.2/README.md +103 -0
- geopic_tag_reader-1.1.2/docs/develop.md +99 -0
- geopic_tag_reader-1.1.2/docs/index.md +115 -0
- geopic_tag_reader-1.1.2/docs/install.md +82 -0
- geopic_tag_reader-1.1.2/docs/tech/api_reference.md +25 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/geopic_tag_reader/__init__.py +1 -1
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/geopic_tag_reader/camera.py +14 -3
- geopic_tag_reader-1.1.2/geopic_tag_reader/i18n.py +8 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/geopic_tag_reader/main.py +2 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/geopic_tag_reader/reader.py +87 -27
- geopic_tag_reader-1.1.2/geopic_tag_reader/translations/fr/LC_MESSAGES/geopic_tag_reader.po +114 -0
- geopic_tag_reader-1.1.2/geopic_tag_reader/translations/geopic_tag_reader.pot +111 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/geopic_tag_reader/writer.py +5 -2
- geopic_tag_reader-1.1.2/mkdocs.yml +43 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/pyproject.toml +9 -2
- geopic_tag_reader-1.1.0/Makefile +0 -21
- geopic_tag_reader-1.1.0/README.md +0 -133
- geopic_tag_reader-1.1.0/docs/.pages +0 -4
- geopic_tag_reader-1.1.0/docs/API_USAGE.md +0 -45
- geopic_tag_reader-1.1.0/docs/Develop.md +0 -50
- geopic_tag_reader-1.1.0/docs/Install.md +0 -75
- geopic_tag_reader-1.1.0/docs/camera.md +0 -44
- geopic_tag_reader-1.1.0/docs/model.md +0 -29
- geopic_tag_reader-1.1.0/docs/reader.md +0 -381
- geopic_tag_reader-1.1.0/docs/writer.md +0 -167
- geopic_tag_reader-1.1.0/tests/__init__.py +0 -0
- geopic_tag_reader-1.1.0/tests/conftest.py +0 -9
- geopic_tag_reader-1.1.0/tests/fixtures/1.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/IMG_20210720_144918.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/IMG_20210720_161352.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/a1.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/b1.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/broken_makernotes.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/c1.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/charset.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/cropped.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/d1.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/datetime_ms_float.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/datetime_offset.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/e1.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/flat.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/gopromax_flat.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/gps_date_slash.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/gps_date_time_stamp.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_Ricoh_Theta.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_V4MPack.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_categorisee.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_datetimeoriginal.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_gps_date_string.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_gps_datestamp.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_gps_sotm.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_invalid_gps_date.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_without_coord.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_without_dt.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/img_without_exif_tags.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/insta360_date.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/int_long_tag.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/out_of_bounds_lat.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/out_of_bounds_lon.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/pic_with_float_lat.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/fixtures/ricoh_theta_no_projection.jpg +0 -0
- geopic_tag_reader-1.1.0/tests/test_main.py +0 -17
- geopic_tag_reader-1.1.0/tests/test_reader.py +0 -636
- geopic_tag_reader-1.1.0/tests/test_writer.py +0 -269
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/.pre-commit-config.yaml +0 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/CODE_OF_CONDUCT.md +0 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/LICENSE +0 -0
- /geopic_tag_reader-1.1.0/docs/CLI_USAGE.md → /geopic_tag_reader-1.1.2/docs/tech/cli.md +0 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/geopic_tag_reader/model.py +0 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/geopic_tag_reader/py.typed +0 -0
- {geopic_tag_reader-1.1.0 → geopic_tag_reader-1.1.2}/pytest.ini +0 -0
|
@@ -40,8 +40,9 @@ deploy_pypi:
|
|
|
40
40
|
stage: deploy
|
|
41
41
|
image: python:3.8
|
|
42
42
|
script:
|
|
43
|
-
- apt update && apt install gcc git
|
|
43
|
+
- apt update && apt install -y gcc git gettext
|
|
44
44
|
- pip install .[build]
|
|
45
|
+
- make i18n-po2code
|
|
45
46
|
- flit publish # use [flit](https://flit.pypa.io/) and FLIT_USERNAME/FLIT_PASSWORD env var
|
|
46
47
|
only:
|
|
47
48
|
- tags
|
|
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.1.2] - 2024-06-25
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Support of translations for warning/error messages.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Update docs to match organization rename on Gitlab from GeoVisio to Panoramax
|
|
19
|
+
- Test for 360° pictures recognition based on make & model handles different string cases
|
|
20
|
+
|
|
21
|
+
## [1.1.1] - 2024-04-26
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Reader now handles pitch & roll values from various EXIF/XMP tags.
|
|
26
|
+
|
|
10
27
|
## [1.1.0] - 2024-04-17
|
|
11
28
|
|
|
12
29
|
### Changed
|
|
@@ -114,7 +131,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
114
131
|
|
|
115
132
|
### Changed
|
|
116
133
|
|
|
117
|
-
- Bump [Typer](typer.tiangolo.com/) version, and use fork of [Typer-cli](https://gitlab.com/
|
|
134
|
+
- Bump [Typer](typer.tiangolo.com/) version, and use fork of [Typer-cli](https://gitlab.com/panoramax/server/infra/typer-cli)
|
|
118
135
|
|
|
119
136
|
## [0.1.2]
|
|
120
137
|
|
|
@@ -158,25 +175,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
158
175
|
|
|
159
176
|
### Added
|
|
160
177
|
|
|
161
|
-
- EXIF tag reading methods extracted from [GeoVisio API](https://gitlab.com/
|
|
162
|
-
|
|
163
|
-
[Unreleased]: https://gitlab.com/
|
|
164
|
-
[1.1.
|
|
165
|
-
[1.
|
|
166
|
-
[1.0
|
|
167
|
-
[1.0.
|
|
168
|
-
[1.0.
|
|
169
|
-
[1.0.
|
|
170
|
-
[1.0.
|
|
171
|
-
[1.0.
|
|
172
|
-
[0.
|
|
173
|
-
[0.
|
|
174
|
-
[0.
|
|
175
|
-
[0.
|
|
176
|
-
[0.
|
|
177
|
-
[0.
|
|
178
|
-
[0.
|
|
179
|
-
[0.1.
|
|
180
|
-
[0.1.
|
|
181
|
-
[0.
|
|
182
|
-
[0.0
|
|
178
|
+
- EXIF tag reading methods extracted from [GeoVisio API](https://gitlab.com/panoramax/server/api)
|
|
179
|
+
|
|
180
|
+
[Unreleased]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.1.2...main
|
|
181
|
+
[1.1.2]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.1.1...1.1.2
|
|
182
|
+
[1.1.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.1.0...1.1.1
|
|
183
|
+
[1.1.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.6...1.1.0
|
|
184
|
+
[1.0.6]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.5...1.0.6
|
|
185
|
+
[1.0.5]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.4...1.0.5
|
|
186
|
+
[1.0.4]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.3...1.0.4
|
|
187
|
+
[1.0.3]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.2...1.0.3
|
|
188
|
+
[1.0.2]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.1...1.0.2
|
|
189
|
+
[1.0.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.0...1.0.1
|
|
190
|
+
[1.0.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.4.1...1.0.0
|
|
191
|
+
[0.4.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.4.0...0.4.1
|
|
192
|
+
[0.4.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.3.1...0.4.0
|
|
193
|
+
[0.3.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.3.0...0.3.1
|
|
194
|
+
[0.3.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.2.0...0.3.0
|
|
195
|
+
[0.2.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.1.3...0.2.0
|
|
196
|
+
[0.1.3]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.1.2...0.1.3
|
|
197
|
+
[0.1.2]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.1.1...0.1.2
|
|
198
|
+
[0.1.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.1.0...0.1.1
|
|
199
|
+
[0.1.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.0.2...0.1.0
|
|
200
|
+
[0.0.2]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.0.1...0.0.2
|
|
201
|
+
[0.0.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/commits/0.0.1
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.DEFAULT_GOAL := help
|
|
2
|
+
|
|
3
|
+
.PHONY: docs test type-check fmt ci
|
|
4
|
+
|
|
5
|
+
prepare_release: i18n-code2pot i18n-po2code docs ci
|
|
6
|
+
|
|
7
|
+
test: ## Run tests
|
|
8
|
+
pytest
|
|
9
|
+
|
|
10
|
+
type-check: ## Check all python types
|
|
11
|
+
mypy geopic_tag_reader/
|
|
12
|
+
|
|
13
|
+
fmt: ## Format code
|
|
14
|
+
black --fast .
|
|
15
|
+
|
|
16
|
+
ci: type-check fmt test ## Run all check like the ci
|
|
17
|
+
|
|
18
|
+
docs: ## Generates documentation from Typer embedded docs
|
|
19
|
+
python -m typer ./geopic_tag_reader/main.py utils docs --name geopic-tag-reader --output docs/tech/cli.md
|
|
20
|
+
|
|
21
|
+
help: ## Print this help message
|
|
22
|
+
@grep -E '^[a-zA-Z_-]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
|
23
|
+
|
|
24
|
+
#############################
|
|
25
|
+
# Internationalization
|
|
26
|
+
#
|
|
27
|
+
|
|
28
|
+
# Extract labels from Python code into POT catalog
|
|
29
|
+
i18n-code2pot:
|
|
30
|
+
xgettext -d geopic_tag_reader -o geopic_tag_reader/translations/geopic_tag_reader.pot geopic_tag_reader/*.py
|
|
31
|
+
|
|
32
|
+
# Transform all PO translated files into MO for Python to use them
|
|
33
|
+
SOURCES=$(wildcard geopic_tag_reader/translations/**/LC_MESSAGES/*.po)
|
|
34
|
+
TARGETS=$(SOURCES:.po=.mo)
|
|
35
|
+
i18n-po2code: $(TARGETS)
|
|
36
|
+
%.mo: %.po
|
|
37
|
+
msgfmt $< -o $@
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: geopic-tag-reader
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: GeoPicTagReader
|
|
5
5
|
Author-email: Adrien PAVIE <panieravide@riseup.net>
|
|
6
6
|
Requires-Python: >=3.8
|
|
@@ -17,39 +17,26 @@ Requires-Dist: black ~= 24.3 ; extra == "dev"
|
|
|
17
17
|
Requires-Dist: mypy ~= 1.9 ; extra == "dev"
|
|
18
18
|
Requires-Dist: pytest ~= 7.2.0 ; extra == "dev"
|
|
19
19
|
Requires-Dist: pytest-datafiles ~= 3.0 ; extra == "dev"
|
|
20
|
-
Requires-Dist: lazydocs ~= 0.4.8 ; extra == "dev"
|
|
21
20
|
Requires-Dist: types-xmltodict ~= 0.13 ; extra == "dev"
|
|
22
21
|
Requires-Dist: pre-commit ~= 3.3.3 ; extra == "dev"
|
|
22
|
+
Requires-Dist: mkdocs-material ~= 9.5.21 ; extra == "docs"
|
|
23
|
+
Requires-Dist: mkdocstrings[python] ~= 0.25.1 ; extra == "docs"
|
|
23
24
|
Requires-Dist: python-dateutil ~= 2.8.2 ; extra == "write-exif"
|
|
24
|
-
|
|
25
|
+
Requires-Dist: types-python-dateutil ~= 2.9.0.20240316 ; extra == "write-exif"
|
|
26
|
+
Project-URL: Home, https://gitlab.com/panoramax/server/geo-picture-tag-reader
|
|
25
27
|
Provides-Extra: build
|
|
26
28
|
Provides-Extra: dev
|
|
29
|
+
Provides-Extra: docs
|
|
27
30
|
Provides-Extra: write-exif
|
|
28
31
|
|
|
29
|
-
#  Panoramax
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
➡️ __Give it a try__ at [panoramax.ign.fr](https://panoramax.ign.fr/) or [geovisio.fr](https://geovisio.fr/viewer) !
|
|
34
|
-
|
|
35
|
-
## 📦 Components
|
|
36
|
-
|
|
37
|
-
GeoVisio is __modular__ and made of several components, each of them standardized and ♻️ replaceable.
|
|
38
|
-
|
|
39
|
-

|
|
40
|
-
|
|
41
|
-
All of them are 📖 __open-source__ and available online:
|
|
42
|
-
|
|
43
|
-
| 🌐 Server | 💻 Client |
|
|
44
|
-
|:-----------------------------------------------------------------------:|:----------------------------------------------------:|
|
|
45
|
-
| [API](https://gitlab.com/geovisio/api) | [Website](https://gitlab.com/geovisio/website) |
|
|
46
|
-
| [Blur API](https://gitlab.com/geovisio/blurring) | [Web viewer](https://gitlab.com/geovisio/web-viewer) |
|
|
47
|
-
| [GeoPic Tag Reader](https://gitlab.com/geovisio/geo-picture-tag-reader) | [Command line](https://gitlab.com/geovisio/cli) |
|
|
34
|
+
__Panoramax__ is a digital resource for sharing and exploiting 📍📷 field photos. Anyone can take photographs of places visible from the public streets and contribute them to the Panoramax database. This data is then freely accessible and reusable by all. More information available at [gitlab.com/panoramax](https://gitlab.com/panoramax) and [panoramax.fr](https://panoramax.fr/).
|
|
48
35
|
|
|
49
36
|
|
|
50
37
|
# 📷 GeoPic Tag Reader
|
|
51
38
|
|
|
52
|
-
This repository only contains the Python library to __read and write standardized metadata__ from geolocated pictures EXIF metadata.
|
|
39
|
+
This repository only contains the Python library to __read and write standardized metadata__ from geolocated pictures EXIF metadata. It can be used completely apart from all GeoVisio/Panoramax components for your own projects and needs.
|
|
53
40
|
|
|
54
41
|
## Features
|
|
55
42
|
|
|
@@ -71,7 +58,7 @@ geopic-tag-reader --help
|
|
|
71
58
|
|
|
72
59
|
To know more about install and other options, see [install documentation](./docs/Install.md).
|
|
73
60
|
|
|
74
|
-
If at some point you're lost or need help, you can contact us through [issues](https://gitlab.com/
|
|
61
|
+
If at some point you're lost or need help, you can contact us through [issues](https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/issues) or by [email](mailto:panieravide@riseup.net).
|
|
75
62
|
|
|
76
63
|
|
|
77
64
|
## Usage
|
|
@@ -137,26 +124,12 @@ editedImg.close()
|
|
|
137
124
|
|
|
138
125
|
## Contributing
|
|
139
126
|
|
|
140
|
-
Pull requests are welcome. For major changes, please open an [issue](https://gitlab.com/
|
|
127
|
+
Pull requests are welcome. For major changes, please open an [issue](https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/issues) first to discuss what you would like to change.
|
|
141
128
|
|
|
142
129
|
More information about developing is available in [documentation](./docs/Develop.md).
|
|
143
130
|
|
|
144
131
|
|
|
145
|
-
## 🤗 Special thanks
|
|
146
|
-
|
|
147
|
-

|
|
148
|
-
|
|
149
|
-
GeoVisio was made possible thanks to a group of ✨ __amazing__ people ✨ :
|
|
150
|
-
|
|
151
|
-
- __[GéoVélo](https://geovelo.fr/)__ team, for 💶 funding initial development and for 🔍 testing/improving software
|
|
152
|
-
- __[Carto Cité](https://cartocite.fr/)__ team (in particular Antoine Riche), for 💶 funding improvements on viewer (map browser, flat pictures support)
|
|
153
|
-
- __[La Fabrique des Géocommuns (IGN)](https://www.ign.fr/institut/la-fabrique-des-geocommuns-incubateur-de-communs-lign)__ for offering long-term support and funding the [Panoramax](https://panoramax.fr/) initiative and core team (Camille Salou, Mathilde Ferrey, Christian Quest, Antoine Desbordes, Jean Andreani, Adrien Pavie)
|
|
154
|
-
- Many _many_ __wonderful people__ who worked on various parts of GeoVisio or core dependencies we use : 🧙 Stéphane Péneau, 🎚 Albin Calais & Cyrille Giquello, 📷 [Damien Sorel](https://www.strangeplanet.fr/), Pascal Rhod, Nick Whitelegg...
|
|
155
|
-
- __[Adrien Pavie](https://pavie.info/)__, for ⚙️ initial development of GeoVisio
|
|
156
|
-
- And you all ✨ __GeoVisio users__ for making this project useful !
|
|
157
|
-
|
|
158
|
-
|
|
159
132
|
## ⚖️ License
|
|
160
133
|
|
|
161
|
-
Copyright (c)
|
|
134
|
+
Copyright (c) Panoramax team 2022-2024, [released under MIT license](https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/blob/main/LICENSE).
|
|
162
135
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#  Panoramax
|
|
2
|
+
|
|
3
|
+
__Panoramax__ is a digital resource for sharing and exploiting 📍📷 field photos. Anyone can take photographs of places visible from the public streets and contribute them to the Panoramax database. This data is then freely accessible and reusable by all. More information available at [gitlab.com/panoramax](https://gitlab.com/panoramax) and [panoramax.fr](https://panoramax.fr/).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# 📷 GeoPic Tag Reader
|
|
7
|
+
|
|
8
|
+
This repository only contains the Python library to __read and write standardized metadata__ from geolocated pictures EXIF metadata. It can be used completely apart from all GeoVisio/Panoramax components for your own projects and needs.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
This tool allows you to:
|
|
13
|
+
|
|
14
|
+
- 🔍 Analyse various EXIF variables to extract standardized metadata for geolocated pictures applications (coordinates, date, orientation, altitude...)
|
|
15
|
+
- ✏️ Edit a picture to change its EXIF variables through a simpler command
|
|
16
|
+
- 💻 Either as Python code or as a command-line utility
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
The library can be installed easily, for a quick glance:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install geopic_tag_reader
|
|
25
|
+
geopic-tag-reader --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
To know more about install and other options, see [install documentation](./docs/Install.md).
|
|
29
|
+
|
|
30
|
+
If at some point you're lost or need help, you can contact us through [issues](https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/issues) or by [email](mailto:panieravide@riseup.net).
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
This library can be used both from command-line or as Python module.
|
|
36
|
+
|
|
37
|
+
### As command-line
|
|
38
|
+
|
|
39
|
+
To see all available commands:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
geopic-tag-reader --help
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
To read metadata from a single picture:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
geopic-tag-reader read --image /path/to/my_image.jpg
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
To edit metadata of a single picture, for example change its capture date:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
geopic-tag-reader write \
|
|
55
|
+
--input /path/to/original_image.jpg \
|
|
56
|
+
--capture-time "2023-01-01T12:56:38Z" \
|
|
57
|
+
--output /path/to/edited_image.jpg
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
[Full documentation is also available here](./docs/CLI_USAGE.md).
|
|
61
|
+
|
|
62
|
+
### As Python library
|
|
63
|
+
|
|
64
|
+
In your own script, for reading and writing a picture metadata, you can use:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from geopic_tag_reader import reader, writer, model
|
|
68
|
+
|
|
69
|
+
# Open image as binary file
|
|
70
|
+
img = open("my_picture.jpg", "rb")
|
|
71
|
+
imgBytes = img.read()
|
|
72
|
+
img.close()
|
|
73
|
+
|
|
74
|
+
# Read EXIF metadata
|
|
75
|
+
metadata = reader.readPictureMetadata(imgBytes)
|
|
76
|
+
print(metadata)
|
|
77
|
+
|
|
78
|
+
# Edit picture EXIF metadata
|
|
79
|
+
editedMetadata = writer.PictureMetadata(
|
|
80
|
+
picture_type = model.PictureType.equirectangular,
|
|
81
|
+
direction = writer.Direction(125)
|
|
82
|
+
)
|
|
83
|
+
editedImgBytes = writer.writePictureMetadata(imgBytes, editedMetadata)
|
|
84
|
+
|
|
85
|
+
# Save edited file
|
|
86
|
+
editedImg = open("my_new_picture.jpg", "wb")
|
|
87
|
+
editedImg.write(editedImgBytes)
|
|
88
|
+
editedImg.close()
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
[Full documentation is also available here](./docs/API_USAGE.md).
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## Contributing
|
|
95
|
+
|
|
96
|
+
Pull requests are welcome. For major changes, please open an [issue](https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/issues) first to discuss what you would like to change.
|
|
97
|
+
|
|
98
|
+
More information about developing is available in [documentation](./docs/Develop.md).
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
## ⚖️ License
|
|
102
|
+
|
|
103
|
+
Copyright (c) Panoramax team 2022-2024, [released under MIT license](https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/blob/main/LICENSE).
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Development
|
|
2
|
+
|
|
3
|
+
## Tests
|
|
4
|
+
|
|
5
|
+
Tests are run using PyTest. You can simply run this command to launch tests:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pytest
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Documentation
|
|
12
|
+
|
|
13
|
+
High-level documentation is handled by [Typer](https://typer.tiangolo.com/). You can update the generated `USAGE.md` file using this command:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
make docs
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
[Mkdocs](https://www.mkdocs.org/) is also used to generate a clean web page for documentation, you can check out its rendering by launching:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install -e .[docs]
|
|
23
|
+
mkdocs serve
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Translations
|
|
27
|
+
|
|
28
|
+
Translations and internationalization are managed with Python `gettext`. Translations files are located in `geopic_tag_reader/geopic_tag_reader/translations/` folder. You can make a string in code translated using:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
# Load i18n module
|
|
32
|
+
from geopic_tag_reader.i18n import _
|
|
33
|
+
|
|
34
|
+
# Use _ function to translate
|
|
35
|
+
print(_("My label is {mood}").format(mood="good"))
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Once you have done all your translations, run this command to update the POT label catalog (you will need to have the [`gettext` utilities](https://www.gnu.org/software/gettext/) installed):
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
make i18n-code2pot
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then, our translations are managed through [our Weblate instance](https://weblate.panoramax.xyz/).
|
|
45
|
+
|
|
46
|
+
If you want to convert translated PO files into MO files, you can run:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
make i18n-po2code
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
To switch language to use, you can either pass it as environment variable, or using a global variable:
|
|
53
|
+
|
|
54
|
+
=== "Environment variable"
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
LANG=fr geopic-tag-reader read --image myimg.jpg
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
=== "Global variable"
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
# This should be set before importing the i18n module
|
|
64
|
+
LANG="fr"
|
|
65
|
+
from geopic_tag_reader.i18n import _
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Contributing
|
|
69
|
+
|
|
70
|
+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
|
71
|
+
|
|
72
|
+
Note that before opening a pull requests, you may want to check formatting and tests of your changes:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
make ci
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
You can also install git [pre-commit](https://pre-commit.com/) hooks to format code on commit with:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pip install -e .[dev]
|
|
82
|
+
pre-commit install
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Make a release
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
git checkout main
|
|
89
|
+
git pull
|
|
90
|
+
|
|
91
|
+
vim CHANGELOG.md # Edit version + links at bottom
|
|
92
|
+
vim geopic_tag_reader/__init__.py # Edit version
|
|
93
|
+
make prepare_release
|
|
94
|
+
|
|
95
|
+
git add *
|
|
96
|
+
git commit -m "Release x.x.x"
|
|
97
|
+
git tag -a x.x.x -m "Release x.x.x"
|
|
98
|
+
git push origin main --tags
|
|
99
|
+
```
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Pictures metadata
|
|
2
|
+
|
|
3
|
+
Panoramax have some prerequisites for a pictures to be accepted:
|
|
4
|
+
|
|
5
|
+
- Position 📍
|
|
6
|
+
- Capture time ⏲️
|
|
7
|
+
|
|
8
|
+
Those metadata are usually integrated inside the picture file (in what is called [EXIF tags](https://en.wikipedia.org/wiki/Exif)). For some complex use cases, those tags can also be given alongside the picture to the uploading API.
|
|
9
|
+
|
|
10
|
+
## :octicons-file-binary-16: Exif tags
|
|
11
|
+
|
|
12
|
+
Exif tags are quite complex and usually one metadata can be read from several EXIF tags. In order to handle many camera vendors, Panoramax will try to read each metadata from several EXIF tags.
|
|
13
|
+
|
|
14
|
+
!!! note
|
|
15
|
+
|
|
16
|
+
The following documentation uses the [Exiv2](https://exiv2.org) notation for EXIF tags as it gives a unique identifier for an EXIF tag, and is the notation used by the API to expose those tags.
|
|
17
|
+
|
|
18
|
+
!!! note
|
|
19
|
+
|
|
20
|
+
Panoramax accepts both __360° and classic/flat pictures__.
|
|
21
|
+
|
|
22
|
+
### 📍 GPS coordinates
|
|
23
|
+
|
|
24
|
+
📍 GPS coordinates are read from:
|
|
25
|
+
|
|
26
|
+
- `Exif.GPSInfo.GPSLatitude`/`Exif.GPSInfo.GPSLatitudeRef`, `Exif.GPSInfo.GPSLongitude`/`Exif.GPSInfo.GPSLongitudeRef`
|
|
27
|
+
- or `Xmp.exif.GPSLatitude`/`Xmp.exif.GPSLatitudeRef`, `Xmp.exif.GPSLongitude`/`Xmp.exif.GPSLongitudeRef`
|
|
28
|
+
- or in [Mapillary](https://www.mapillary.com/) tags: `MAPLatitude`/`MAPLongitude`
|
|
29
|
+
|
|
30
|
+
### ⏲️ Capture time
|
|
31
|
+
|
|
32
|
+
⏲️ Capture time is read from:
|
|
33
|
+
|
|
34
|
+
- `Exif.GPSInfo.GPSDateStamp`
|
|
35
|
+
- `Exif.GPSInfo.GPSDateTime`
|
|
36
|
+
- `Xmp.exif.GPSDateStamp`
|
|
37
|
+
- `Xmp.exif.GPSDateTime`
|
|
38
|
+
- `Exif.Image.DateTimeOriginal`
|
|
39
|
+
- `Exif.Photo.DateTimeOriginal`
|
|
40
|
+
- `Exif.Image.DateTime`
|
|
41
|
+
- `Xmp.GPano.SourceImageCreateTime`
|
|
42
|
+
- or in [Mapillary](https://www.mapillary.com/) tags: `MAPGpsTime`
|
|
43
|
+
|
|
44
|
+
### Optional metadata
|
|
45
|
+
|
|
46
|
+
The following EXIF tags are recognized and used if defined, but are **optional**:
|
|
47
|
+
|
|
48
|
+
#### 🧭 Image orientation
|
|
49
|
+
|
|
50
|
+
Image orientation is read from
|
|
51
|
+
|
|
52
|
+
- `GPSImgDirection`
|
|
53
|
+
- `GPano:PoseHeadingDegrees`
|
|
54
|
+
- or in [Mapillary](https://www.mapillary.com/) tags: `MAPCompassHeading`
|
|
55
|
+
|
|
56
|
+
#### :material-timer: Milliseconds in date
|
|
57
|
+
|
|
58
|
+
Milliseconds in date is reade from `SubSecTimeOriginal`.
|
|
59
|
+
|
|
60
|
+
#### :material-panorama-sphere-outline: 360° or flat
|
|
61
|
+
|
|
62
|
+
To detect if a picture is 360° / spherical, we use `GPano:ProjectionType` or an heuristic based on the model of the camera and dimension of the picture ([see doc for more details](./tech/api_reference.md#camera)).
|
|
63
|
+
|
|
64
|
+
#### 📷 Make and model
|
|
65
|
+
|
|
66
|
+
Camera vendor (`make`) is read from:
|
|
67
|
+
|
|
68
|
+
- `Exif.Image.Make`
|
|
69
|
+
- or in [Mapillary](https://www.mapillary.com/) tags: `MAPDeviceMake`
|
|
70
|
+
|
|
71
|
+
Camera model is read from:
|
|
72
|
+
|
|
73
|
+
- `Exif.Image.Model`
|
|
74
|
+
- or in [Mapillary](https://www.mapillary.com/) tags: `MAPDeviceModel`
|
|
75
|
+
|
|
76
|
+
#### Focal length
|
|
77
|
+
|
|
78
|
+
Camera focal length (to get precise field of view) is read from:
|
|
79
|
+
|
|
80
|
+
- `Exif.Image.FocalLength`
|
|
81
|
+
- `Exif.Photo.FocalLength`
|
|
82
|
+
|
|
83
|
+
#### :octicons-horizontal-rule-16: Pitch and roll
|
|
84
|
+
|
|
85
|
+
Pitch value is read from:
|
|
86
|
+
|
|
87
|
+
- `Xmp.Camera.Pitch`
|
|
88
|
+
- `Exif.GPSInfo.GPSPitch`
|
|
89
|
+
- `Xmp.GPano.PosePitchDegrees`
|
|
90
|
+
- `Xmp.GPano.InitialViewPitchDegrees`
|
|
91
|
+
|
|
92
|
+
Roll value is read from:
|
|
93
|
+
|
|
94
|
+
- `Xmp.Camera.Roll`
|
|
95
|
+
- `Exif.GPSInfo.GPSRoll`
|
|
96
|
+
- `Xmp.GPano.PoseRollDegrees`
|
|
97
|
+
- `Xmp.GPano.InitialViewRollDegrees`
|
|
98
|
+
|
|
99
|
+
#### ⛰️ Altitude
|
|
100
|
+
|
|
101
|
+
Altitude is read from:
|
|
102
|
+
|
|
103
|
+
- `Exif.GPSInfo.GPSAltitude`
|
|
104
|
+
|
|
105
|
+
## :simple-python: Using as Python library
|
|
106
|
+
|
|
107
|
+
All this metadata reading logic has been extracted in a python library.
|
|
108
|
+
|
|
109
|
+
[:octicons-arrow-right-24: How to use as a Python library](./tech/api_reference.md)
|
|
110
|
+
|
|
111
|
+
## :octicons-terminal-16: Using as Command-line tool
|
|
112
|
+
|
|
113
|
+
A command-line tool is also available to quickly read and write a picture's metadata.
|
|
114
|
+
|
|
115
|
+
[:octicons-arrow-right-24: How to use the command-line tool](./tech/cli.md)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Install as a command-line tool
|
|
2
|
+
|
|
3
|
+
GeoPicTagReader can be installed using two methods:
|
|
4
|
+
|
|
5
|
+
- :simple-python: From [PyPI](https://pypi.org/project/geopic-tag-reader/), the Python central package repository
|
|
6
|
+
- :simple-git: Using this [Git repository](https://gitlab.com/panoramax/server/geo-picture-tag-reader)
|
|
7
|
+
|
|
8
|
+
GeoPicTagReader is compatible with all Python versions >= 3.8.
|
|
9
|
+
|
|
10
|
+
!!! note
|
|
11
|
+
Due to [Pyexiv2 dependency on a recent GLIBC version](https://github.com/LeoHsiao1/pyexiv2/issues/120), you have to make sure to run on a recent, up-to-date operating system.
|
|
12
|
+
|
|
13
|
+
=== ":simple-python: PyPI"
|
|
14
|
+
|
|
15
|
+
Just launch this command:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install geopic_tag_reader
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
=== "pipx"
|
|
22
|
+
|
|
23
|
+
Alternatively, you can use [pipx](https://github.com/pypa/pipx) if you want all the script dependencies to be in a custom virtual env.
|
|
24
|
+
|
|
25
|
+
You need to [install pipx](https://pypa.github.io/pipx/installation/), then:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pipx install geopic_tag_reader
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
=== ":simple-git: Git repository"
|
|
32
|
+
|
|
33
|
+
Download the repository:
|
|
34
|
+
|
|
35
|
+
<div class="annotate" markdown>
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://gitlab.com/panoramax/server/geo-picture-tag-reader.git geopic_tag_reader
|
|
39
|
+
cd geopic_tag_reader/
|
|
40
|
+
|
|
41
|
+
# Create the virtual environment in a folder named "env" (1)
|
|
42
|
+
python3 -m venv env
|
|
43
|
+
|
|
44
|
+
# Launches utilities to make environment available in your Bash
|
|
45
|
+
source ./env/bin/activate
|
|
46
|
+
|
|
47
|
+
# Then, install the dependencies using pip:
|
|
48
|
+
pip install -e .
|
|
49
|
+
```
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
1. To avoid conflicts, it's considered a good practice to create a _[virtual environment](https://docs.python.org/3/library/venv.html)_ (or virtualenv).
|
|
53
|
+
|
|
54
|
+
After this you should be able to use the CLI tool with the name `geopic-tag-reader`:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
geopic-tag-reader --help
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Write EXIF tags
|
|
61
|
+
|
|
62
|
+
If you want to be able to write exif tags, you need to also install the `write-exif` extra:
|
|
63
|
+
|
|
64
|
+
This will install [libexiv2](https://exiv2.org/) if available in the target platform.
|
|
65
|
+
|
|
66
|
+
=== ":simple-python: PyPI"
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install geopic_tag_reader[write-exif]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
=== "pipx"
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pipx install geopic_tag_reader[write-exif]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
=== ":simple-git: Git repository"
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pip install -e .[write-exif]
|
|
82
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Tag Reader's API Reference
|
|
2
|
+
|
|
3
|
+
## Reader
|
|
4
|
+
|
|
5
|
+
::: geopic_tag_reader.reader
|
|
6
|
+
|
|
7
|
+
## Writer
|
|
8
|
+
|
|
9
|
+
!!! warning
|
|
10
|
+
|
|
11
|
+
To use this module, you need to install the `write-exif` dependency:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install -e .[write-exif]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
::: geopic_tag_reader.writer
|
|
18
|
+
|
|
19
|
+
## Camera
|
|
20
|
+
|
|
21
|
+
::: geopic_tag_reader.camera
|
|
22
|
+
|
|
23
|
+
## Model
|
|
24
|
+
|
|
25
|
+
::: geopic_tag_reader.model
|