Coder Social home page Coder Social logo

py3exiv2's Introduction

py3exiv2
*******

Welcome to py3exiv2, a python 3 binding to exiv2 (http://exiv2.org/), the C++
library for manipulation of EXIF, IPTC and XMP image metadata.
It is a python 3 module that allows your python scripts to read and write
metadata (EXIF, IPTC, XMP, thumbnails) embedded in image files
(JPEG, TIFF, ...).

Point your browser to http://exiv2.org/metadata.html for the complete metadata
tag reference.


Build dependencies
==================

py3exiv2 depends on the following libraries:

 * python (≥ 3.2)
 * boost.python3 (http://www.boost.org/libs/python/doc/index.html)
 * exiv2 (http://www.exiv2.org/)

Some examples in src/ use PyGTK (http://www.pygtk.org/) and PyQt
(http://www.riverbankcomputing.co.uk/software/pyqt/) to display image previews,
those are optional dependencies.

This is a typical list of build dependencies for a Debian/Ubuntu system:

 * python-all-dev (≥ 3.2)
 * libexiv2-dev (≥ 0.20)
 * libboost-python-dev (≥ 1.48)
 * g++


Building and installing
=======================

To build and install the library, while in the top-level directory
(e.g. '~/dev/p3yexiv2', which should contain a file named 'configure.py'),
run the following commands:

 $ python3 configure.py     # To chek your environment and write the Makefile
 $ ./build.sh               # To compile the lib
 $ ./build.sh -i            # as administrator to install all files

You can run configure.py with the following arguments:
    -h                  show the help message and exit
    --libboost=FILE     where FILE is the full path of libboost-python3
                        e.g. `/usr/lib/x86_64-linux-gnu/libboost_python-py34.so`

The result of the build is a dynamic library, libexiv2python.so, in the build/
directory. This is the low-level binding. It is in turn used in a higher level
module, pyexiv2.
The `./build.sh -i` command installs the two modules in your site-specific directory
for Python modules (e.g. '/usr/lib/python3/dist-packages/' on Linux).

To use py3exiv2 in your scripts, simply import the pyexiv2 module.

Note: the lib name is py3exiv2 but, for compatibility, the top-level module 
      is named pyexiv2


Documentation
=============

You can find the API documentation at: 
    http://python3-exiv2.readthedocs.org/en/latest
or refer to the internal documentation for a guide on how to use py3exiv2.
In a python interpreter, type:

 >>> import pyexiv2
 >>> help(pyexiv2)


License
=======

Copyright (C) 2006-2011 Olivier Tilloy <[email protected]>
Copyright (C) 2015 Vincent Vande Vyvre <[email protected]>

py3exiv2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License version 3 as published by the Free
Software Foundation.

py3exiv2 is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with py3exiv2; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.


Developers
==========

py3exiv2 is Free Software, meaning that you are encouraged to play with it,
modify it to suit your needs and contribute back your changes and bug fixes.

The bug tracking system and the main bazaar branch are hosted at Launchpad:

 https://launchpad.net/py3exiv2

To get a working copy of the latest version of the code, you need to have bazaar
(http://bazaar.canonical.com/) installed:

 $ bzr branch lp:py3exiv2

Feedback, bug reports and patches are welcome!


py3exiv2's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

py3exiv2's Issues

Compile hangs on Raspberry pi with 512 mb memory including 1024 swap space

I use pyexiv2 in my pi-timolo project that runs under python 2 or 3. There is a pip install for python2 but for python3, I have written a bash script to automate install of dependencies, git clone, configure, compile, install your project. This works fine on RPI's with 1 GB memory and there are no problems other than taking a bit of time to compile.

A user on a RPI zero with 512 memory complained that compile would hang. I tested and even with 1024 mb of swap the compile consumes all memory and hangs. Also swap memory is very slow since RPI OS is run on SD card.
Are there any ways to reduce the amount of memory required to compile so it can compile with 512 of RAM memory?
Thanks Claude ...

py3exxiv2 for Windows

When I try to install py3exiv2 under windows using pip using python 3.8.5, it fails with this output:

C:\Windows\System32>python -m pip install py3exiv2
Collecting py3exiv2
  Using cached py3exiv2-0.9.3.tar.gz (36 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: py3exiv2
  Building wheel for py3exiv2 (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.8
      creating build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\exif.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\iptc.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\metadata.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\preview.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\utils.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\xmp.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\__init__.py -> build\lib.win-amd64-3.8\pyexiv2
      running build_ext
      building 'libexiv2python' extension
      creating build\temp.win-amd64-3.8
      creating build\temp.win-amd64-3.8\Release
      creating build\temp.win-amd64-3.8\Release\src
      C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\arnold\AppData\Local\Programs\PythonCodingPack\include -IC:\Users\arnold\AppData\Local\Programs\PythonCodingPack\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsrc/exiv2wrapper.cpp /Fobuild\temp.win-amd64-3.8\Release\src/exiv2wrapper.obj -g
      cl : Command line warning D9002 : ignoring unknown option '-g'
      exiv2wrapper.cpp
      T:\arnold\pip-install-_6jws8ko\py3exiv2_b73208a96cd548cdb2ee3ba4999ac72c\src\exiv2wrapper.hpp(32): fatal error C1083: Cannot open include file: 'exiv2/exiv2.hpp': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for py3exiv2
  Running setup.py clean for py3exiv2
Failed to build py3exiv2
Installing collected packages: py3exiv2
  Running setup.py install for py3exiv2 ... error
  error: subprocess-exited-with-error

  × Running setup.py install for py3exiv2 did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      running install
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.8
      creating build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\exif.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\iptc.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\metadata.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\preview.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\utils.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\xmp.py -> build\lib.win-amd64-3.8\pyexiv2
      copying src\pyexiv2\__init__.py -> build\lib.win-amd64-3.8\pyexiv2
      running build_ext
      building 'libexiv2python' extension
      creating build\temp.win-amd64-3.8
      creating build\temp.win-amd64-3.8\Release
      creating build\temp.win-amd64-3.8\Release\src
      C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\arnold\AppData\Local\Programs\PythonCodingPack\include -IC:\Users\arnold\AppData\Local\Programs\PythonCodingPack\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsrc/exiv2wrapper.cpp /Fobuild\temp.win-amd64-3.8\Release\src/exiv2wrapper.obj -g
      cl : Command line warning D9002 : ignoring unknown option '-g'
      exiv2wrapper.cpp
      T:\arnold\pip-install-_6jws8ko\py3exiv2_b73208a96cd548cdb2ee3ba4999ac72c\src\exiv2wrapper.hpp(32): fatal error C1083: Cannot open include file: 'exiv2/exiv2.hpp': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> py3exiv2

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

C:\Windows\System32>

Having trouble installing on Raspbian Stretch and Jessie

Trying to install py3exiv2 onto a raspberry pi using

sudo pip3 install py3exiv2

Install errors out per below. Also see log at bottom. I have checked setuptools and that appears OK

Any help would be appreciated

Thanks Claude ...


building 'libexiv2python' extension

creating build/temp.linux-armv7l-3.4

creating build/temp.linux-armv7l-3.4/src

arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c src/exiv2wrapper.cpp -o build/temp.linux-armv7l-3.4/src/exiv2wrapper.o -g

cc1plus: warning: command line option â-Wstrict-prototypesâ is valid for C/ObjC but not for C++

In file included from src/exiv2wrapper.cpp:27:0:

src/exiv2wrapper.hpp:32:27: fatal error: exiv2/image.hpp: No such file or directory

#include "exiv2/image.hpp"

                       ^

compilation terminated.

error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;file='/tmp/pip-build-yq2gn5az/py3exiv2/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-6sofkvu8-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-yq2gn5az/py3exiv2
Storing debug log for failure in /root/.pip/pip.log


Here is the log

$ sudo cat /root/.pip/pip.log

/usr/bin/pip3 run on Wed Nov 29 15:07:16 2017
Downloading/unpacking pyexiv2
Getting page https://pypi.python.org/simple/pyexiv2/
Could not fetch URL https://pypi.python.org/simple/pyexiv2/: 404 Client Error: Not Found (pyexiv2 does not exist)
Will skip URL https://pypi.python.org/simple/pyexiv2/ when looking for download links for pyexiv2
Getting page https://pypi.python.org/simple/
URLs to search for versions for pyexiv2:

  • https://pypi.python.org/simple/pyexiv2/
    Getting page https://pypi.python.org/simple/pyexiv2/
    Could not fetch URL https://pypi.python.org/simple/pyexiv2/: 404 Client Error: Not Found (pyexiv2 does not exist)
    Will skip URL https://pypi.python.org/simple/pyexiv2/ when looking for download links for pyexiv2
    Could not find any downloads that satisfy the requirement pyexiv2
    Cleaning up...
    No distributions at all found for pyexiv2
    Exception information:
    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
    File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 290, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
    File "/usr/lib/python3/dist-packages/pip/req.py", line 1178, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
    File "/usr/lib/python3/dist-packages/pip/index.py", line 277, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
    pip.exceptions.DistributionNotFound: No distributions at all found for pyexiv2

edit metadata from buffer

I try to edit meta data from buffer
meta = pyexiv2.ImageMetadata.from_buffer
meta.read()
meta['Exif.Photo.UserComment'] = 'abc'
meta.write()

The question is how can I retrieve the file buffer without saving to disk? thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.