You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ Date (Timezone) | Version | Comment
9
9
03/26/2022 06:48:01 AM (PDT) | 0.5.3 | Quite a few docstring changes<br>ExifToolHelper's get_tags() and set_tags() checks tag names to prevent inadvertent write behavior<br>Renamed a few of the errors to make sure the errors are explicit<br>ExifToolHelper() has some static helper methods which can be used when extending the class (ExifToolAlpha.set_keywords_batch() demonstrates a sample usage).<br>setup.py tweaked to make it Beta rather than Alpha<br>ExifToolAlpha.get_tag() updated to make it more robust.<br>Fixed ujson compatibility<br>Cleaned up and refactored testing.
10
10
08/27/2022 06:06:32 PM (PDT) | 0.5.4 | New Feature: added raw_bytes parameter to ExifTool.execute() to return bytes only with no decoding conversion.<br>Changed: ExifTool.execute() now accepts both [str,bytes]. When given str, it will encode according to the ExifTool.encoding property.<br>Changed: ExifToolHelper.execute() now accepts Any type, and will do a str() on any non-str parameter.<br>Technical change: Popen() no longer uses an -encoding parameter, therefore working with the socket is back to bytes when interfacing with the exiftool subprocess. This should be invisible to most users as the default behavior will still be the same.<br>Tests: Created associated test with a custom makernotes example to write and read back bytes.<br>Docs: Updated documentation with comprehensive samples, and a better FAQ section for common problems.
11
11
12/30/2022 02:35:18 PM (PST) | 0.5.5 | No functional changes, only a huge speed improvement with large operations :: Update: Speed up large responses from exiftool. Instead of using + string concatenation, uses list appends and reverse(), which results in a speedup of 10x+ for large operations. See more details from the [reported issue](https://github.com/sylikc/pyexiftool/issues/60) and [PR 61](https://github.com/sylikc/pyexiftool/pull/61) by [prutschman](https://github.com/prutschman)
12
+
10/22/2023 03:21:46 PM (PDT) | 0.5.6 | New Feature: added method ExifTool.set_json_loads() which allows setting a method to replace the json.loads() called in ExifTool.execute_json().<br>This permits passing additional configuration parameters to address the [reported issue](https://github.com/sylikc/pyexiftool/issues/76).<br>All documentation has been updated and two accompanying FAQ entries have been written to describe the new functionality. Test cases have been written to test the new functionality and some baseline exiftool tests to ensure that the behavior remains consistent across tests.
12
13
13
14
14
15
Follow maintenance/release-process.html when releasing a version.
@@ -61,9 +62,10 @@ Check for changes at the following resources to see if anyone has added some nif
61
62
62
63
We can also direct users here or answer existing questions as to how to use the original version of ExifTool.
63
64
64
-
(last checked 2/28/2022 all)
65
+
(last checked 10/23/2023 all)
65
66
66
67
search "pyexiftool github" to see if you find any more random ports/forks
67
68
check for updates https://github.com/smarnach/pyexiftool/pulls
68
69
check for new open issues https://github.com/smarnach/pyexiftool/issues?q=is%3Aissue+is%3Aopen
69
70
71
+
answer relevant issues on stackoverflow (make sure it's related to the latest version) https://stackoverflow.com/search?tab=newest&q=pyexiftool&searchOn=3
There is no universal fix which wouldn't affect other behaviors in PyExifTool, so this is an advanced workaround if you encounter this specific problem.
139
+
140
+
PyExifTool does not do any processing on the fields returned by *exiftool*. In effect, what is returned is processed directly by ``json.loads()`` by default.
141
+
142
+
You can change the behavior of the json string parser, or specify a different one using :py:meth:`exiftool.ExifTool.set_json_loads`.
143
+
144
+
The `documentation of CPython's json.load`_ allows ``parse_float`` to be any parser of choice when a float is encountered in a JSON file. Thus, you can force the float to be interpreted as a string.
145
+
However, as you can see below, it also *changes the behavior of all float fields*.
146
+
147
+
148
+
.. _`documentation of CPython's json.load`: https://docs.python.org/3/library/json.html#json.load
Unfortunately you can either change all float fields to a string, or possibly lose some float precision when working with floats in string metadata fields.
168
+
169
+
There isn't any known universal workaround which wouldn't break one thing or the other, as it is an underlying *exiftool* quirk.
170
+
171
+
There are other edge cases which may exhibit quirky behavior when storing numbers and whitespace only to text fields (See `test cases related to numeric tags`_). Since PyExifTool cannot accommodate all possible edge cases,
172
+
this workaround will allow you to configure PyExifTool to work in your environment!
173
+
174
+
.. _`test cases related to numeric tags`: https://github.com/sylikc/pyexiftool/blob/master/tests/test_helper_tags_float.py
175
+
176
+
177
+
I would like to use a faster json string parser
178
+
===============================================
179
+
180
+
By default, PyExifTool uses the built-in ``json`` library to load the json string returned by *exiftool*. If you would like to use an alternate library, set it manually using :py:meth:`exiftool.ExifTool.set_json_loads`
181
+
182
+
183
+
.. code-block::
184
+
185
+
import exiftool, json
186
+
with exiftool.ExifToolHelper() as et:
187
+
et.set_json_loads(ujson.loads)
188
+
...
189
+
190
+
.. note::
191
+
192
+
In PyExifTool version before 0.5.6, ``ujson`` was supported automatically if the package was installed.
193
+
194
+
To support any possible alternative JSON library, this behavior has now been changed and it must be enabled manually.
195
+
196
+
106
197
I'm getting an error! How do I debug PyExifTool output?
0 commit comments