geopic-tag-reader 1.1.1__tar.gz → 1.1.3__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.
Files changed (76) hide show
  1. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/.gitignore +2 -0
  2. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/.gitlab-ci.yml +6 -3
  3. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/CHANGELOG.md +43 -24
  4. geopic_tag_reader-1.1.3/Makefile +37 -0
  5. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/PKG-INFO +12 -39
  6. geopic_tag_reader-1.1.3/README.md +103 -0
  7. geopic_tag_reader-1.1.3/docs/develop.md +89 -0
  8. geopic_tag_reader-1.1.3/docs/index.md +115 -0
  9. geopic_tag_reader-1.1.3/docs/install.md +82 -0
  10. geopic_tag_reader-1.1.3/docs/tech/api_reference.md +25 -0
  11. geopic_tag_reader-1.1.1/docs/CLI_USAGE.md → geopic_tag_reader-1.1.3/docs/tech/cli.md +2 -0
  12. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/geopic_tag_reader/__init__.py +1 -1
  13. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/geopic_tag_reader/camera.py +14 -3
  14. geopic_tag_reader-1.1.3/geopic_tag_reader/i18n.py +11 -0
  15. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/geopic_tag_reader/main.py +18 -13
  16. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/geopic_tag_reader/reader.py +68 -38
  17. geopic_tag_reader-1.1.3/geopic_tag_reader/translations/fr/LC_MESSAGES/geopic_tag_reader.po +114 -0
  18. geopic_tag_reader-1.1.3/geopic_tag_reader/translations/geopic_tag_reader.pot +147 -0
  19. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/geopic_tag_reader/writer.py +6 -2
  20. geopic_tag_reader-1.1.3/mkdocs.yml +43 -0
  21. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/pyproject.toml +9 -2
  22. geopic_tag_reader-1.1.1/Makefile +0 -21
  23. geopic_tag_reader-1.1.1/README.md +0 -133
  24. geopic_tag_reader-1.1.1/docs/.pages +0 -4
  25. geopic_tag_reader-1.1.1/docs/API_USAGE.md +0 -45
  26. geopic_tag_reader-1.1.1/docs/Develop.md +0 -50
  27. geopic_tag_reader-1.1.1/docs/Install.md +0 -75
  28. geopic_tag_reader-1.1.1/docs/camera.md +0 -44
  29. geopic_tag_reader-1.1.1/docs/model.md +0 -29
  30. geopic_tag_reader-1.1.1/docs/reader.md +0 -387
  31. geopic_tag_reader-1.1.1/docs/writer.md +0 -167
  32. geopic_tag_reader-1.1.1/tests/__init__.py +0 -0
  33. geopic_tag_reader-1.1.1/tests/conftest.py +0 -9
  34. geopic_tag_reader-1.1.1/tests/fixtures/1.jpg +0 -0
  35. geopic_tag_reader-1.1.1/tests/fixtures/IMG_20210720_144918.jpg +0 -0
  36. geopic_tag_reader-1.1.1/tests/fixtures/IMG_20210720_161352.jpg +0 -0
  37. geopic_tag_reader-1.1.1/tests/fixtures/a1.jpg +0 -0
  38. geopic_tag_reader-1.1.1/tests/fixtures/b1.jpg +0 -0
  39. geopic_tag_reader-1.1.1/tests/fixtures/broken_makernotes.jpg +0 -0
  40. geopic_tag_reader-1.1.1/tests/fixtures/c1.jpg +0 -0
  41. geopic_tag_reader-1.1.1/tests/fixtures/charset.jpg +0 -0
  42. geopic_tag_reader-1.1.1/tests/fixtures/cropped.jpg +0 -0
  43. geopic_tag_reader-1.1.1/tests/fixtures/d1.jpg +0 -0
  44. geopic_tag_reader-1.1.1/tests/fixtures/datetime_ms_float.jpg +0 -0
  45. geopic_tag_reader-1.1.1/tests/fixtures/datetime_offset.jpg +0 -0
  46. geopic_tag_reader-1.1.1/tests/fixtures/e1.jpg +0 -0
  47. geopic_tag_reader-1.1.1/tests/fixtures/flat.jpg +0 -0
  48. geopic_tag_reader-1.1.1/tests/fixtures/gopromax_flat.jpg +0 -0
  49. geopic_tag_reader-1.1.1/tests/fixtures/gps_date_slash.jpg +0 -0
  50. geopic_tag_reader-1.1.1/tests/fixtures/gps_date_time_stamp.jpg +0 -0
  51. geopic_tag_reader-1.1.1/tests/fixtures/img_Ricoh_Theta.jpg +0 -0
  52. geopic_tag_reader-1.1.1/tests/fixtures/img_V4MPack.jpg +0 -0
  53. geopic_tag_reader-1.1.1/tests/fixtures/img_categorisee.jpg +0 -0
  54. geopic_tag_reader-1.1.1/tests/fixtures/img_datetimeoriginal.jpg +0 -0
  55. geopic_tag_reader-1.1.1/tests/fixtures/img_gps_date_string.jpg +0 -0
  56. geopic_tag_reader-1.1.1/tests/fixtures/img_gps_datestamp.jpg +0 -0
  57. geopic_tag_reader-1.1.1/tests/fixtures/img_gps_sotm.jpg +0 -0
  58. geopic_tag_reader-1.1.1/tests/fixtures/img_invalid_gps_date.jpg +0 -0
  59. geopic_tag_reader-1.1.1/tests/fixtures/img_without_coord.jpg +0 -0
  60. geopic_tag_reader-1.1.1/tests/fixtures/img_without_dt.jpg +0 -0
  61. geopic_tag_reader-1.1.1/tests/fixtures/img_without_exif_tags.jpg +0 -0
  62. geopic_tag_reader-1.1.1/tests/fixtures/insta360_date.jpg +0 -0
  63. geopic_tag_reader-1.1.1/tests/fixtures/int_long_tag.jpg +0 -0
  64. geopic_tag_reader-1.1.1/tests/fixtures/out_of_bounds_lat.jpg +0 -0
  65. geopic_tag_reader-1.1.1/tests/fixtures/out_of_bounds_lon.jpg +0 -0
  66. geopic_tag_reader-1.1.1/tests/fixtures/pic_with_float_lat.jpg +0 -0
  67. geopic_tag_reader-1.1.1/tests/fixtures/ricoh_theta_no_projection.jpg +0 -0
  68. geopic_tag_reader-1.1.1/tests/test_main.py +0 -17
  69. geopic_tag_reader-1.1.1/tests/test_reader.py +0 -646
  70. geopic_tag_reader-1.1.1/tests/test_writer.py +0 -269
  71. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/.pre-commit-config.yaml +0 -0
  72. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/CODE_OF_CONDUCT.md +0 -0
  73. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/LICENSE +0 -0
  74. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/geopic_tag_reader/model.py +0 -0
  75. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/geopic_tag_reader/py.typed +0 -0
  76. {geopic_tag_reader-1.1.1 → geopic_tag_reader-1.1.3}/pytest.ini +0 -0
@@ -5,3 +5,5 @@ env/
5
5
  venv
6
6
  .cache/
7
7
  .vscode/
8
+ site/
9
+ *.mo
@@ -25,23 +25,26 @@ lint:
25
25
  tests-reader:
26
26
  image: python:3.8
27
27
  script:
28
- - apt update && apt install gcc
28
+ - apt update && apt install gcc gettext
29
29
  - pip install .[dev]
30
+ - make i18n-po2code
30
31
  - pytest -s -vv --ignore=tests/test_writer.py --ignore=geopic_tag_reader/writer.py
31
32
 
32
33
  tests-writer:
33
34
  image: python:3.8
34
35
  script:
35
- - apt update && apt install gcc
36
+ - apt update && apt install gcc gettext
36
37
  - pip install .[dev,write-exif]
38
+ - make i18n-po2code
37
39
  - pytest -s -vv
38
40
 
39
41
  deploy_pypi:
40
42
  stage: deploy
41
43
  image: python:3.8
42
44
  script:
43
- - apt update && apt install gcc git
45
+ - apt update && apt install -y gcc git gettext
44
46
  - pip install .[build]
47
+ - make i18n-po2code
45
48
  - flit publish # use [flit](https://flit.pypa.io/) and FLIT_USERNAME/FLIT_PASSWORD env var
46
49
  only:
47
50
  - 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.3] - 2024-07-10
11
+
12
+ ### Changed
13
+
14
+ - Translations are handled per function call, language code passed as parameter for reader and writer.
15
+
16
+ ## [1.1.2] - 2024-06-25
17
+
18
+ ### Added
19
+
20
+ - Support of translations for warning/error messages.
21
+
22
+ ### Changed
23
+
24
+ - Update docs to match organization rename on Gitlab from GeoVisio to Panoramax
25
+ - Test for 360° pictures recognition based on make & model handles different string cases
26
+
10
27
  ## [1.1.1] - 2024-04-26
11
28
 
12
29
  ### Added
@@ -120,7 +137,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
120
137
 
121
138
  ### Changed
122
139
 
123
- - Bump [Typer](typer.tiangolo.com/) version, and use fork of [Typer-cli](https://gitlab.com/geovisio/infra/typer-cli)
140
+ - Bump [Typer](typer.tiangolo.com/) version, and use fork of [Typer-cli](https://gitlab.com/panoramax/server/infra/typer-cli)
124
141
 
125
142
  ## [0.1.2]
126
143
 
@@ -164,26 +181,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
164
181
 
165
182
  ### Added
166
183
 
167
- - EXIF tag reading methods extracted from [GeoVisio API](https://gitlab.com/geovisio/api)
168
-
169
- [Unreleased]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/1.1.1...main
170
- [1.1.1]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/1.1.0...1.1.1
171
- [1.1.0]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/1.0.6...1.1.0
172
- [1.0.6]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/1.0.5...1.0.6
173
- [1.0.5]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/1.0.4...1.0.5
174
- [1.0.4]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/1.0.3...1.0.4
175
- [1.0.3]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/1.0.2...1.0.3
176
- [1.0.2]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/1.0.1...1.0.2
177
- [1.0.1]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/1.0.0...1.0.1
178
- [1.0.0]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.4.1...1.0.0
179
- [0.4.1]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.4.0...0.4.1
180
- [0.4.0]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.3.1...0.4.0
181
- [0.3.1]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.3.0...0.3.1
182
- [0.3.0]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.2.0...0.3.0
183
- [0.2.0]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.1.3...0.2.0
184
- [0.1.3]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.1.2...0.1.3
185
- [0.1.2]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.1.1...0.1.2
186
- [0.1.1]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.1.0...0.1.1
187
- [0.1.0]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.0.2...0.1.0
188
- [0.0.2]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/compare/0.0.1...0.0.2
189
- [0.0.1]: https://gitlab.com/geovisio/geo-picture-tag-reader/-/commits/0.0.1
184
+ - EXIF tag reading methods extracted from [GeoVisio API](https://gitlab.com/panoramax/server/api)
185
+
186
+ [Unreleased]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.1.3...main
187
+ [1.1.3]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.1.2...1.1.3
188
+ [1.1.2]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.1.1...1.1.2
189
+ [1.1.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.1.0...1.1.1
190
+ [1.1.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.6...1.1.0
191
+ [1.0.6]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.5...1.0.6
192
+ [1.0.5]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.4...1.0.5
193
+ [1.0.4]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.3...1.0.4
194
+ [1.0.3]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.2...1.0.3
195
+ [1.0.2]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.1...1.0.2
196
+ [1.0.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/1.0.0...1.0.1
197
+ [1.0.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.4.1...1.0.0
198
+ [0.4.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.4.0...0.4.1
199
+ [0.4.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.3.1...0.4.0
200
+ [0.3.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.3.0...0.3.1
201
+ [0.3.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.2.0...0.3.0
202
+ [0.2.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.1.3...0.2.0
203
+ [0.1.3]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.1.2...0.1.3
204
+ [0.1.2]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.1.1...0.1.2
205
+ [0.1.1]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.1.0...0.1.1
206
+ [0.1.0]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.0.2...0.1.0
207
+ [0.0.2]: https://gitlab.com/panoramax/server/geo-picture-tag-reader/-/compare/0.0.1...0.0.2
208
+ [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.1
3
+ Version: 1.1.3
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
- Project-URL: Home, https://gitlab.com/geovisio/geo-picture-tag-reader
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
- # ![GeoVisio](https://gitlab.com/geovisio/api/-/raw/develop/images/logo_full.png)
32
+ # ![Panoramax](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Panoramax.svg/40px-Panoramax.svg.png) Panoramax
30
33
 
31
- __GeoVisio__ is a complete solution for storing and __serving your own 📍📷 geolocated pictures__ (like [StreetView](https://www.google.com/streetview/) / [Mapillary](https://mapillary.com/)).
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
- ![GeoVisio architecture](https://gitlab.com/geovisio/api/-/raw/develop/images/big_picture.png)
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/geovisio/geo-picture-tag-reader/-/issues) or by [email](mailto:panieravide@riseup.net).
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/geovisio/geo-picture-tag-reader/-/issues) first to discuss what you would like to change.
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
- ![Sponsors](https://gitlab.com/geovisio/api/-/raw/develop/images/sponsors.png)
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) GeoVisio team 2022-2023, [released under MIT license](https://gitlab.com/geovisio/geo-picture-tag-reader/-/blob/main/LICENSE).
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](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Panoramax.svg/40px-Panoramax.svg.png) 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,89 @@
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 init as i18n_init
33
+
34
+ # Create translator with appropriate language
35
+ _ = i18n_init("fr")
36
+
37
+ # Use _ function to translate
38
+ print(_("My label is {mood}").format(mood="good"))
39
+ ```
40
+
41
+ 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):
42
+
43
+ ```bash
44
+ make i18n-code2pot
45
+ ```
46
+
47
+ Then, our translations are managed through [our Weblate instance](https://weblate.panoramax.xyz/).
48
+
49
+ If you want to convert translated PO files into MO files, you can run:
50
+
51
+ ```bash
52
+ make i18n-po2code
53
+ ```
54
+
55
+ ## Contributing
56
+
57
+ Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
58
+
59
+ Note that before opening a pull requests, you may want to check formatting and tests of your changes:
60
+
61
+ ```bash
62
+ make ci
63
+ ```
64
+
65
+ You can also install git [pre-commit](https://pre-commit.com/) hooks to format code on commit with:
66
+
67
+ ```bash
68
+ pip install -e .[dev]
69
+ pre-commit install
70
+ ```
71
+
72
+ ## Make a release
73
+
74
+ ```bash
75
+ git checkout develop
76
+ git pull
77
+
78
+ vim CHANGELOG.md # Edit version + links at bottom
79
+ vim geopic_tag_reader/__init__.py # Edit version
80
+ make prepare_release
81
+
82
+ git add *
83
+ git commit -m "Release x.x.x"
84
+ git tag -a x.x.x -m "Release x.x.x"
85
+ git push origin develop
86
+ git checkout main
87
+ git merge develop
88
+ git push origin main --tags
89
+ ```
@@ -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