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: USAGE.rst
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -387,8 +387,8 @@ Doing so will invalidate the memoryview and may cause a segmentation fault:
387
387
Buffer interface
388
388
----------------
389
389
390
-
The ``Exiv2::DataBuf``, ``Exiv2::PreviewImage``, and ``Exiv2::MemIO`` classes are all wrappers around a potentially large block of memory.
391
-
They each have methods to access that memory without copying, such as ``Exiv2::DataBuf::data()`` and ``Exiv2::MemIo::mmap()`` but in Python these classes also expose a `buffer interface`_. This allows them to be used almost anywhere that a `bytes-like object`_ is expected.
390
+
The ``Exiv2::DataBuf``, ``Exiv2::PreviewImage``, and ``Exiv2::BasicIO`` classes are all wrappers around a potentially large block of memory.
391
+
They each have methods to access that memory without copying, such as ``Exiv2::DataBuf::data()`` and ``Exiv2::BasicIo::mmap()`` but in Python these classes also expose a `buffer interface`_. This allows them to be used almost anywhere that a `bytes-like object`_ is expected.
392
392
393
393
For example, you could save a photograph's thumbnail in a separate file like this:
394
394
@@ -406,8 +406,7 @@ In python-exiv2 the ``data`` and ``size`` parameters are replaced with a single
406
406
The buffered data isn't actually read until ``Image::readMetadata`` is called, so python-exiv2 stores a reference to the buffer to stop the user accidentally deleting it.
407
407
408
408
When ``Image::writeMetadata`` is called exiv2 allocates a new block of memory to store the modified data.
409
-
The ``Image::io`` method returns an `Exiv2::MemIo`_ object that provides access to this data.
410
-
(`Exiv2::MemIo`_ is derived from `Exiv2::BasicIo`_.)
409
+
The ``Image::io`` method returns an `Exiv2::BasicIo`_ object that provides access to this data.
411
410
412
411
The ``BasicIo::mmap`` method allows access to the image file data without unnecessary copying.
413
412
However it is rather error prone, crashing your Python program with a segmentation fault if anything goes wrong.
@@ -453,7 +452,7 @@ Since python-exiv2 v0.15.0 this buffer can be writeable:
453
452
data[23] =157# modifies data buffer
454
453
image.readMetadata() # reads modified buffer data
455
454
456
-
The modified data is written back to the file (for ``Exiv2::FileIo``) or memory buffer (for `Exiv2::MemIo`_) when the memoryview_ is released.
455
+
The modified data is written back to the file or memory buffer when the memoryview_ is released.
0 commit comments