%global _empty_manifest_terminate_build 0
Name: python-imgtag
Version: 1.1.6
Release: 1
Summary: Simple XMP Image Tag & Metadata Editing Library
License: GNU General Public License v3 (GPLv3)
URL: https://github.com/nimaid/python-imgtag
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/2d/24/0413a44b9698ecb2078c767591d74b9dae87f2b8ab0937b77a52978f48ec/imgtag-1.1.6.tar.gz
BuildArch: noarch
%description
# ImgTag
### Simple XMP Image Tag & Metadata Editing Module
It is recomended to install using Conda to create a virtual python environment, as it makes it easy to install and manage different packages. Use the following commands to set up an environment:
```
conda env create -f environment.yml
conda activate imgtag
```
If you choose to install manually, you must install `exempi` for your OS.
For Debian:
```
sudo apt-get install -y exempi
```
For a Conda environment:
```
conda install -c conda-forge exempi
```
Once `exempi` is installed, install `imgtag` with:
```
python3 -m pip install -y imgtag
```
To use `imgtag`:
```python
from imgtag import ImgTag
# Open image for tag editing
test = ImgTag(
filename="test.jpg", # The image file
force_case="lower", # Converts the case of all tags
# Can be `None`, `"lower"`, `"upper"`
# Default: None
strip=True, # Strips whitespace from the ends of all tags
# Default: True
no_duplicates=True, # Removes all duplicate tags (case sensitive)
# Default: True
use_warnings=True # Toggles warnings
# Default: True
memory_limit_ratio=0.8 # The maximum percent of free memory to use
# Default: 0.8
)
# Print existing tags
print("Current tags:")
for tag in test.get_tags():
print(" Tag:", tag)
# Add tags
test.add_tags(["sleepy", "happy"])
# Remove tags
test.remove_tags(["cute"])
# Set tags, removing all existing tags
test.set_tags(["dog", "good boy"])
# Save changes and close file
test.close()
# Re-open for tag editing
test.open()
# Remove all tags
test.clear_tags()
# Delete the ImgTag object, automatically saving and closing the file
del(test)
```
%package -n python3-imgtag
Summary: Simple XMP Image Tag & Metadata Editing Library
Provides: python-imgtag
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-imgtag
# ImgTag
### Simple XMP Image Tag & Metadata Editing Module
It is recomended to install using Conda to create a virtual python environment, as it makes it easy to install and manage different packages. Use the following commands to set up an environment:
```
conda env create -f environment.yml
conda activate imgtag
```
If you choose to install manually, you must install `exempi` for your OS.
For Debian:
```
sudo apt-get install -y exempi
```
For a Conda environment:
```
conda install -c conda-forge exempi
```
Once `exempi` is installed, install `imgtag` with:
```
python3 -m pip install -y imgtag
```
To use `imgtag`:
```python
from imgtag import ImgTag
# Open image for tag editing
test = ImgTag(
filename="test.jpg", # The image file
force_case="lower", # Converts the case of all tags
# Can be `None`, `"lower"`, `"upper"`
# Default: None
strip=True, # Strips whitespace from the ends of all tags
# Default: True
no_duplicates=True, # Removes all duplicate tags (case sensitive)
# Default: True
use_warnings=True # Toggles warnings
# Default: True
memory_limit_ratio=0.8 # The maximum percent of free memory to use
# Default: 0.8
)
# Print existing tags
print("Current tags:")
for tag in test.get_tags():
print(" Tag:", tag)
# Add tags
test.add_tags(["sleepy", "happy"])
# Remove tags
test.remove_tags(["cute"])
# Set tags, removing all existing tags
test.set_tags(["dog", "good boy"])
# Save changes and close file
test.close()
# Re-open for tag editing
test.open()
# Remove all tags
test.clear_tags()
# Delete the ImgTag object, automatically saving and closing the file
del(test)
```
%package help
Summary: Development documents and examples for imgtag
Provides: python3-imgtag-doc
%description help
# ImgTag
### Simple XMP Image Tag & Metadata Editing Module
It is recomended to install using Conda to create a virtual python environment, as it makes it easy to install and manage different packages. Use the following commands to set up an environment:
```
conda env create -f environment.yml
conda activate imgtag
```
If you choose to install manually, you must install `exempi` for your OS.
For Debian:
```
sudo apt-get install -y exempi
```
For a Conda environment:
```
conda install -c conda-forge exempi
```
Once `exempi` is installed, install `imgtag` with:
```
python3 -m pip install -y imgtag
```
To use `imgtag`:
```python
from imgtag import ImgTag
# Open image for tag editing
test = ImgTag(
filename="test.jpg", # The image file
force_case="lower", # Converts the case of all tags
# Can be `None`, `"lower"`, `"upper"`
# Default: None
strip=True, # Strips whitespace from the ends of all tags
# Default: True
no_duplicates=True, # Removes all duplicate tags (case sensitive)
# Default: True
use_warnings=True # Toggles warnings
# Default: True
memory_limit_ratio=0.8 # The maximum percent of free memory to use
# Default: 0.8
)
# Print existing tags
print("Current tags:")
for tag in test.get_tags():
print(" Tag:", tag)
# Add tags
test.add_tags(["sleepy", "happy"])
# Remove tags
test.remove_tags(["cute"])
# Set tags, removing all existing tags
test.set_tags(["dog", "good boy"])
# Save changes and close file
test.close()
# Re-open for tag editing
test.open()
# Remove all tags
test.clear_tags()
# Delete the ImgTag object, automatically saving and closing the file
del(test)
```
%prep
%autosetup -n imgtag-1.1.6
%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-imgtag -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Mon Apr 10 2023 Python_Bot - 1.1.6-1
- Package Spec generated