Skip to content

Commit

Permalink
[lib] update exiv2 to v0.28.3
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoHsiao1 committed Jul 8, 2024
1 parent c4fa863 commit 94dc830
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 38 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
os: [ubuntu-22.04]
python_version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
exiv2_version: [0.28.1]
exiv2_version: [0.28.3]
runs-on: ${{matrix.os}}
env:
PLATFORM_NAME: linux
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
matrix:
os: [macos-12]
python_version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
exiv2_version: [0.28.1]
exiv2_version: [0.28.3]
runs-on: ${{matrix.os}}
env:
PLATFORM_NAME: darwin
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
matrix:
os: [windows-2019]
python_version: [3.6, 3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
exiv2_version: [0.28.1]
exiv2_version: [0.28.3]
runs-on: ${{matrix.os}}
env:
PLATFORM_NAME: win
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install pyexiv2==2.12.0
python -m pip install pyexiv2==2.14.0
python -m pip install pytest psutil
- name: Test
run: |
Expand All @@ -50,7 +50,7 @@ jobs:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install pyexiv2==2.12.0
python -m pip install pyexiv2==2.14.0
python -m pip install pytest psutil
- name: Test
run: |
Expand All @@ -77,7 +77,7 @@ jobs:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install pyexiv2==2.12.0
python -m pip install pyexiv2==2.14.0
python -m pip install pytest psutil
- name: Test
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule ".github/exiv2"]
path = .github/exiv2
url = https://github.com/Exiv2/exiv2.git
branch = v0.28.1
branch = v0.28.3
6 changes: 3 additions & 3 deletions docs/Tutorial-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def convert_iptc_to_xmp(data: dict, encoding='utf-8') -> dict
def convert_xmp_to_exif(data: dict, encoding='utf-8') -> dict
def convert_xmp_to_iptc(data: dict, encoding='utf-8') -> dict

__version__ = '2.12.0'
__exiv2_version__ = '0.28.1'
__version__ = '2.14.0'
__exiv2_version__ = '0.28.3'
```

## class Image
Expand Down Expand Up @@ -330,7 +330,7 @@ __exiv2_version__ = '0.28.1'

## convert

- Exiv2 支持将某些 EXIFIPTC 标签,转换成 XMP 标签,也支持反向转换。参考:<https://github.com/Exiv2/exiv2/blob/v0.28.1/src/convert.cpp#L313>
- Exiv2 支持将某些 EXIFIPTC 标签,转换成 XMP 标签,也支持反向转换。参考:<https://github.com/Exiv2/exiv2/blob/v0.28.3/src/convert.cpp#L313>
- 示例:
```py
>>> pyexiv2.convert_exif_to_xmp({'Exif.Image.Artist': 'test-中文-', 'Exif.Image.Rating': '4'})
Expand Down
6 changes: 3 additions & 3 deletions docs/Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def convert_iptc_to_xmp(data: dict, encoding='utf-8') -> dict
def convert_xmp_to_exif(data: dict, encoding='utf-8') -> dict
def convert_xmp_to_iptc(data: dict, encoding='utf-8') -> dict

__version__ = '2.12.0'
__exiv2_version__ = '0.28.1'
__version__ = '2.14.0'
__exiv2_version__ = '0.28.3'
```

## class Image
Expand Down Expand Up @@ -329,7 +329,7 @@ __exiv2_version__ = '0.28.1'

## convert

- Exiv2 supports converting some EXIF or IPTC tags to XMP tags, and also supports reverse conversion. Reference: <https://github.com/Exiv2/exiv2/blob/v0.28.1/src/convert.cpp#L313>
- Exiv2 supports converting some EXIF or IPTC tags to XMP tags, and also supports reverse conversion. Reference: <https://github.com/Exiv2/exiv2/blob/v0.28.3/src/convert.cpp#L313>
- For example:
```py
>>> pyexiv2.convert_exif_to_xmp({'Exif.Image.Artist': 'test-中文-', 'Exif.Image.Rating': '4'})
Expand Down
2 changes: 1 addition & 1 deletion pyexiv2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .core import *


__version__ = '2.12.0'
__version__ = '2.14.0'
__exiv2_version__ = exiv2api.version()


Expand Down
24 changes: 12 additions & 12 deletions pyexiv2/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@

1. Download [the release of Exiv2](https://www.exiv2.org/archive.html) :
```sh
curl -O https://github.com/Exiv2/exiv2/releases/download/v0.28.1/exiv2-0.28.1-Linux64.tar.gz
tar -zxvf exiv2-0.28.1-Linux64.tar.gz
curl -O https://github.com/Exiv2/exiv2/releases/download/v0.28.3/exiv2-0.28.3-Linux64.tar.gz
tar -zxvf exiv2-0.28.3-Linux64.tar.gz
```

2. Prepare environment variables according to your download path:
```sh
EXIV2_DIR=??/exiv2-0.28.1-Linux64
EXIV2_DIR=??/exiv2-0.28.3-Linux64
LIB_DIR=??/pyexiv2/lib/
cp $EXIV2_DIR/lib/libexiv2.so.0.28.1 $EXIV2_DIR/lib/libexiv2.so
cp $EXIV2_DIR/lib/libexiv2.so.0.28.1 $LIB_DIR/libexiv2.so
cp $EXIV2_DIR/lib/libexiv2.so.0.28.3 $EXIV2_DIR/lib/libexiv2.so
cp $EXIV2_DIR/lib/libexiv2.so.0.28.3 $LIB_DIR/libexiv2.so
```

3. Prepare the python interpreter:
Expand Down Expand Up @@ -65,15 +65,15 @@

1. Download [the release of Exiv2](https://www.exiv2.org/archive.html) :
```sh
curl -O https://github.com/Exiv2/exiv2/releases/download/v0.28.1/exiv2-0.28.1-Darwin.tar.gz
tar -zxvf exiv2-0.28.1-Darwin.tar.gz
curl -O https://github.com/Exiv2/exiv2/releases/download/v0.28.3/exiv2-0.28.3-Darwin.tar.gz
tar -zxvf exiv2-0.28.3-Darwin.tar.gz
```

2. Prepare environment variables according to your download path:
```sh
EXIV2_DIR=??/exiv2-0.28.1-Darwin
EXIV2_DIR=??/exiv2-0.28.3-Darwin
LIB_DIR=??/pyexiv2/lib
cp ${EXIV2_DIR}/lib/libexiv2.0.28.1.dylib ${LIB_DIR}/libexiv2.dylib
cp ${EXIV2_DIR}/lib/libexiv2.0.28.3.dylib ${LIB_DIR}/libexiv2.dylib
```

3. Prepare the python interpreter:
Expand Down Expand Up @@ -102,16 +102,16 @@

1. Download [the release of Exiv2](https://www.exiv2.org/archive.html) :
```sh
curl -O https://github.com/Exiv2/exiv2/releases/download/v0.28.1/exiv2-0.28.1-2019msvc64.zip
python -m zipfile -e exiv2-0.28.1-2019msvc64.zip .
curl -O https://github.com/Exiv2/exiv2/releases/download/v0.28.3/exiv2-0.28.3-2019msvc64.zip
python -m zipfile -e exiv2-0.28.3-2019msvc64.zip .
```

2. Install `Visual Studio 2019` (must use the same version of Visual Studio as the Exiv2 build) , and set the environment variables it needs.

3. Prepare environment variables according to your download path:
```batch
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
set EXIV2_DIR=??\exiv2-0.28.1-2019msvc64
set EXIV2_DIR=??\exiv2-0.28.3-2019msvc64
set LIB_DIR=??\pyexiv2\lib
copy %EXIV2_DIR%\bin\exiv2.dll %LIB_DIR%
```
Expand Down
Binary file modified pyexiv2/lib/exiv2.dll
Binary file not shown.
Binary file modified pyexiv2/lib/libexiv2.dylib
Binary file not shown.
Binary file modified pyexiv2/lib/libexiv2.so
Binary file not shown.
12 changes: 1 addition & 11 deletions pyexiv2/tests/test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def test_version():
try:
from .base import __exiv2_version__
assert __exiv2_version__ == '0.28.1'
assert __exiv2_version__ == '0.28.3'
except:
ENV.skip_test = True
raise
Expand Down Expand Up @@ -265,19 +265,9 @@ def test_registerNs():


def test_enableBMFF():
with pytest.raises(RuntimeError):
with Image(ENV.heic_img) as img:
pass

assert enableBMFF() == True
with Image(ENV.heic_img) as img:
assert img.read_exif()

assert enableBMFF(False) == True
with pytest.raises(RuntimeError):
with Image(ENV.heic_img) as img:
pass


def test_log_level():
with pytest.raises(RuntimeError):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='pyexiv2',
version='2.12.0', # need to set the variable in 'pyexiv2/__init__.py'
version='2.14.0', # need to set the variable in 'pyexiv2/__init__.py'
author='LeoHsiao',
author_email='leohsiao@foxmail.com',
description='Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.',
Expand Down

0 comments on commit 94dc830

Please sign in to comment.