diff options
author | CoprDistGit <copr-devel@lists.fedorahosted.org> | 2023-03-09 07:29:52 +0000 |
---|---|---|
committer | CoprDistGit <copr-devel@lists.fedorahosted.org> | 2023-03-09 07:29:52 +0000 |
commit | 679683aa1213372f9b96017342e0ad64dedc753b (patch) | |
tree | ed7461ed6b1f97eb4b0c6cacb60ae79575529eaa | |
parent | 811ac6c06ba3574630b7043e98c778a2fddd6440 (diff) |
automatic import of python-exif
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-exif.spec | 361 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 363 insertions, 0 deletions
@@ -0,0 +1 @@ +/exif-1.6.0.tar.gz diff --git a/python-exif.spec b/python-exif.spec new file mode 100644 index 0000000..263f565 --- /dev/null +++ b/python-exif.spec @@ -0,0 +1,361 @@ +%global _empty_manifest_terminate_build 0 +Name: python-exif +Version: 1.6.0 +Release: 1 +Summary: Read and modify image EXIF metadata using Python. +License: MIT License +URL: https://gitlab.com/TNThieding/exif +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/69/fc/226f502d3533e7d09876e5c0f9b8a61f84a88944d7815ad3bb9e43895785/exif-1.6.0.tar.gz +BuildArch: noarch + +Requires: python3-plum-py + +%description +############## +[exif] Package +############## + +.. image:: https://www.gitlab.com/TNThieding/exif/badges/master/pipeline.svg + :target: https://gitlab.com/TNThieding/exif + +.. image:: https://www.gitlab.com/tnthieding/exif/badges/master/coverage.svg + :target: https://gitlab.com/TNThieding/exif + +.. image:: https://readthedocs.org/projects/exif/badge/?version=latest + :target: https://exif.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + +.. image:: http://www.mypy-lang.org/static/mypy_badge.svg + :target: http://mypy-lang.org/ + :alt: Checked with mypy + +Read and modify image EXIF metadata using Python without any third-party software +dependencies. For example, batch process image metadata using a Python script. + +.. note:: + + I developed this package in 2018 as a hobby; however, I no longer have the same bandwidth + to work on this project. As always, contributions and bug fixes are welcome and appreciated. + If this package does not suit your needs in its current form, I encourage you to investigate + alternative packages such as piexif_, Pillow_, or the like. + + .. _piexif: https://pypi.org/project/piexif/ + .. _Pillow: https://pypi.org/project/Pillow/ + +*********** +Quick Start +*********** + +Open an image with EXIF metadata using the Python ``open()`` built-in function. Ensure the +binary mode flag is set. Pass this image file object into the ``exif.Image`` class:: + + >>> from exif import Image + >>> with open('grand_canyon.jpg', 'rb') as image_file: + ... my_image = Image(image_file) + ... + >>> my_image.has_exif + True + +List EXIF attributes using the ``list_all()`` method:: + + >>> my_image.list_all() + ['_exif_ifd_pointer', '_gps_ifd_pointer', 'aperture_value', 'brightness_value', 'color_space', + 'components_configuration', 'compression', 'datetime', 'datetime_digitized', 'datetime_original', 'exif_version', + 'exposure_bias_value', 'exposure_mode', 'exposure_program', 'exposure_time', 'f_number', 'flash', + 'flashpix_version', 'focal_length', 'focal_length_in_35mm_film', 'gps_altitude', 'gps_altitude_ref', + 'gps_datestamp', 'gps_dest_bearing', 'gps_dest_bearing_ref', 'gps_horizontal_positioning_error', + 'gps_img_direction', 'gps_img_direction_ref', 'gps_latitude', 'gps_latitude_ref', 'gps_longitude', + 'gps_longitude_ref', 'gps_speed', 'gps_speed_ref', 'gps_timestamp', 'jpeg_interchange_format', + 'jpeg_interchange_format_length', 'lens_make', 'lens_model', 'lens_specification', 'make', 'maker_note', + 'metering_mode', 'model', 'orientation', 'photographic_sensitivity', 'pixel_x_dimension', 'pixel_y_dimension', + 'resolution_unit', 'scene_capture_type', 'scene_type', 'sensing_method', 'shutter_speed_value', 'software', + 'subject_area', 'subsec_time_digitized', 'subsec_time_original', 'white_balance', 'x_resolution', + 'y_and_c_positioning', 'y_resolution'] + +Access EXIF metadata tags using Python attribute notation:: + + >>> # Read tags with Python "get" notation. + >>> my_image.gps_latitude + (36.0, 3.0, 11.08) + >>> my_image.gps_longitude + (112.0, 5.0, 4.18) + >>> my_image.model + 'iPhone 7' + >>> + >>> # Modify tags with Python "set" notation. + >>> my_image.make = "Python" + >>> + >>> # Delete tags with Python "del" notation. + >>> del my_image.gps_latitude + >>> del my_image.gps_longitude + >>> + >>> # Add new tags with Python "set" notation. + >>> from exif import LightSource + >>> my_image.light_source = LightSource.DAYLIGHT + +Write the image with modified EXIF metadata to an image file using ``open()`` in binary +write mode:: + + >>> with open('modified_image.jpg', 'wb') as new_image_file: + ... new_image_file.write(my_image.get_file()) + ... + +Refer to the `usage page <https://exif.readthedocs.io/en/latest/usage.html>`_ for information and examples of alternative ways to access EXIF tags (e.g. +with index/item syntax or with methods). + + + + +%package -n python3-exif +Summary: Read and modify image EXIF metadata using Python. +Provides: python-exif +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-exif +############## +[exif] Package +############## + +.. image:: https://www.gitlab.com/TNThieding/exif/badges/master/pipeline.svg + :target: https://gitlab.com/TNThieding/exif + +.. image:: https://www.gitlab.com/tnthieding/exif/badges/master/coverage.svg + :target: https://gitlab.com/TNThieding/exif + +.. image:: https://readthedocs.org/projects/exif/badge/?version=latest + :target: https://exif.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + +.. image:: http://www.mypy-lang.org/static/mypy_badge.svg + :target: http://mypy-lang.org/ + :alt: Checked with mypy + +Read and modify image EXIF metadata using Python without any third-party software +dependencies. For example, batch process image metadata using a Python script. + +.. note:: + + I developed this package in 2018 as a hobby; however, I no longer have the same bandwidth + to work on this project. As always, contributions and bug fixes are welcome and appreciated. + If this package does not suit your needs in its current form, I encourage you to investigate + alternative packages such as piexif_, Pillow_, or the like. + + .. _piexif: https://pypi.org/project/piexif/ + .. _Pillow: https://pypi.org/project/Pillow/ + +*********** +Quick Start +*********** + +Open an image with EXIF metadata using the Python ``open()`` built-in function. Ensure the +binary mode flag is set. Pass this image file object into the ``exif.Image`` class:: + + >>> from exif import Image + >>> with open('grand_canyon.jpg', 'rb') as image_file: + ... my_image = Image(image_file) + ... + >>> my_image.has_exif + True + +List EXIF attributes using the ``list_all()`` method:: + + >>> my_image.list_all() + ['_exif_ifd_pointer', '_gps_ifd_pointer', 'aperture_value', 'brightness_value', 'color_space', + 'components_configuration', 'compression', 'datetime', 'datetime_digitized', 'datetime_original', 'exif_version', + 'exposure_bias_value', 'exposure_mode', 'exposure_program', 'exposure_time', 'f_number', 'flash', + 'flashpix_version', 'focal_length', 'focal_length_in_35mm_film', 'gps_altitude', 'gps_altitude_ref', + 'gps_datestamp', 'gps_dest_bearing', 'gps_dest_bearing_ref', 'gps_horizontal_positioning_error', + 'gps_img_direction', 'gps_img_direction_ref', 'gps_latitude', 'gps_latitude_ref', 'gps_longitude', + 'gps_longitude_ref', 'gps_speed', 'gps_speed_ref', 'gps_timestamp', 'jpeg_interchange_format', + 'jpeg_interchange_format_length', 'lens_make', 'lens_model', 'lens_specification', 'make', 'maker_note', + 'metering_mode', 'model', 'orientation', 'photographic_sensitivity', 'pixel_x_dimension', 'pixel_y_dimension', + 'resolution_unit', 'scene_capture_type', 'scene_type', 'sensing_method', 'shutter_speed_value', 'software', + 'subject_area', 'subsec_time_digitized', 'subsec_time_original', 'white_balance', 'x_resolution', + 'y_and_c_positioning', 'y_resolution'] + +Access EXIF metadata tags using Python attribute notation:: + + >>> # Read tags with Python "get" notation. + >>> my_image.gps_latitude + (36.0, 3.0, 11.08) + >>> my_image.gps_longitude + (112.0, 5.0, 4.18) + >>> my_image.model + 'iPhone 7' + >>> + >>> # Modify tags with Python "set" notation. + >>> my_image.make = "Python" + >>> + >>> # Delete tags with Python "del" notation. + >>> del my_image.gps_latitude + >>> del my_image.gps_longitude + >>> + >>> # Add new tags with Python "set" notation. + >>> from exif import LightSource + >>> my_image.light_source = LightSource.DAYLIGHT + +Write the image with modified EXIF metadata to an image file using ``open()`` in binary +write mode:: + + >>> with open('modified_image.jpg', 'wb') as new_image_file: + ... new_image_file.write(my_image.get_file()) + ... + +Refer to the `usage page <https://exif.readthedocs.io/en/latest/usage.html>`_ for information and examples of alternative ways to access EXIF tags (e.g. +with index/item syntax or with methods). + + + + +%package help +Summary: Development documents and examples for exif +Provides: python3-exif-doc +%description help +############## +[exif] Package +############## + +.. image:: https://www.gitlab.com/TNThieding/exif/badges/master/pipeline.svg + :target: https://gitlab.com/TNThieding/exif + +.. image:: https://www.gitlab.com/tnthieding/exif/badges/master/coverage.svg + :target: https://gitlab.com/TNThieding/exif + +.. image:: https://readthedocs.org/projects/exif/badge/?version=latest + :target: https://exif.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + +.. image:: http://www.mypy-lang.org/static/mypy_badge.svg + :target: http://mypy-lang.org/ + :alt: Checked with mypy + +Read and modify image EXIF metadata using Python without any third-party software +dependencies. For example, batch process image metadata using a Python script. + +.. note:: + + I developed this package in 2018 as a hobby; however, I no longer have the same bandwidth + to work on this project. As always, contributions and bug fixes are welcome and appreciated. + If this package does not suit your needs in its current form, I encourage you to investigate + alternative packages such as piexif_, Pillow_, or the like. + + .. _piexif: https://pypi.org/project/piexif/ + .. _Pillow: https://pypi.org/project/Pillow/ + +*********** +Quick Start +*********** + +Open an image with EXIF metadata using the Python ``open()`` built-in function. Ensure the +binary mode flag is set. Pass this image file object into the ``exif.Image`` class:: + + >>> from exif import Image + >>> with open('grand_canyon.jpg', 'rb') as image_file: + ... my_image = Image(image_file) + ... + >>> my_image.has_exif + True + +List EXIF attributes using the ``list_all()`` method:: + + >>> my_image.list_all() + ['_exif_ifd_pointer', '_gps_ifd_pointer', 'aperture_value', 'brightness_value', 'color_space', + 'components_configuration', 'compression', 'datetime', 'datetime_digitized', 'datetime_original', 'exif_version', + 'exposure_bias_value', 'exposure_mode', 'exposure_program', 'exposure_time', 'f_number', 'flash', + 'flashpix_version', 'focal_length', 'focal_length_in_35mm_film', 'gps_altitude', 'gps_altitude_ref', + 'gps_datestamp', 'gps_dest_bearing', 'gps_dest_bearing_ref', 'gps_horizontal_positioning_error', + 'gps_img_direction', 'gps_img_direction_ref', 'gps_latitude', 'gps_latitude_ref', 'gps_longitude', + 'gps_longitude_ref', 'gps_speed', 'gps_speed_ref', 'gps_timestamp', 'jpeg_interchange_format', + 'jpeg_interchange_format_length', 'lens_make', 'lens_model', 'lens_specification', 'make', 'maker_note', + 'metering_mode', 'model', 'orientation', 'photographic_sensitivity', 'pixel_x_dimension', 'pixel_y_dimension', + 'resolution_unit', 'scene_capture_type', 'scene_type', 'sensing_method', 'shutter_speed_value', 'software', + 'subject_area', 'subsec_time_digitized', 'subsec_time_original', 'white_balance', 'x_resolution', + 'y_and_c_positioning', 'y_resolution'] + +Access EXIF metadata tags using Python attribute notation:: + + >>> # Read tags with Python "get" notation. + >>> my_image.gps_latitude + (36.0, 3.0, 11.08) + >>> my_image.gps_longitude + (112.0, 5.0, 4.18) + >>> my_image.model + 'iPhone 7' + >>> + >>> # Modify tags with Python "set" notation. + >>> my_image.make = "Python" + >>> + >>> # Delete tags with Python "del" notation. + >>> del my_image.gps_latitude + >>> del my_image.gps_longitude + >>> + >>> # Add new tags with Python "set" notation. + >>> from exif import LightSource + >>> my_image.light_source = LightSource.DAYLIGHT + +Write the image with modified EXIF metadata to an image file using ``open()`` in binary +write mode:: + + >>> with open('modified_image.jpg', 'wb') as new_image_file: + ... new_image_file.write(my_image.get_file()) + ... + +Refer to the `usage page <https://exif.readthedocs.io/en/latest/usage.html>`_ for information and examples of alternative ways to access EXIF tags (e.g. +with index/item syntax or with methods). + + + + +%prep +%autosetup -n exif-1.6.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-exif -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Thu Mar 09 2023 Python_Bot <Python_Bot@openeuler.org> - 1.6.0-1 +- Package Spec generated @@ -0,0 +1 @@ +4fef58b936d8a0be837825aa091567e8 exif-1.6.0.tar.gz |