From b9b3c8f3a9639b7b6628f3c07d31563c16f526b4 Mon Sep 17 00:00:00 2001 From: CodeByMrFinchum Date: Fri, 3 Jan 2025 12:37:54 +0100 Subject: [PATCH 1/8] Adjust for new folder stucture. --- .gitignore | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index b6668dc..3e21bf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ -local_files/ -debug.* -debug_log/ +test/ +dist/ .ropeproject/ __pycache__/ -config/tui_settings.yaml -config/exif.yaml From 8f1e8b8f9ed411a07569b35e8ba3a0a4a81f497a Mon Sep 17 00:00:00 2001 From: CodeByMrFinchum Date: Fri, 3 Jan 2025 12:42:41 +0100 Subject: [PATCH 2/8] Moved all code to src folder --- {optima35 => src/optima35}/__init__.py | 0 {optima35 => src/optima35}/core.py | 0 {optima35 => src/optima35}/image_handler.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {optima35 => src/optima35}/__init__.py (100%) rename {optima35 => src/optima35}/core.py (100%) rename {optima35 => src/optima35}/image_handler.py (100%) diff --git a/optima35/__init__.py b/src/optima35/__init__.py similarity index 100% rename from optima35/__init__.py rename to src/optima35/__init__.py diff --git a/optima35/core.py b/src/optima35/core.py similarity index 100% rename from optima35/core.py rename to src/optima35/core.py diff --git a/optima35/image_handler.py b/src/optima35/image_handler.py similarity index 100% rename from optima35/image_handler.py rename to src/optima35/image_handler.py From 798169234c0b19c25b91176bc5b69564ad76fbb8 Mon Sep 17 00:00:00 2001 From: CodeByMrFinchum Date: Fri, 3 Jan 2025 12:43:02 +0100 Subject: [PATCH 3/8] v0.6.3-a1 --- README.md | 52 +++++++++++++++++++++----------------------------- pyproject.toml | 20 +++++++++++++++++++ 2 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 pyproject.toml diff --git a/README.md b/README.md index 4036576..eaed8f8 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ -# OPTIMA-35 -Very WIP... -Splitting core (OPTIMA35 (this)) and ui ([OptimaLab35](https://gitlab.com/CodeByMrFinchum/optima-lab-35)) +# OPTIMA35 +[optima35](https://gitlab.com/CodeByMrFinchum/optima35) is a package utilizing pillow and piexif to modify images, I have also an GUI for this package, [OptimaLab35](https://gitlab.com/CodeByMrFinchum/OptimaLab35) -[pip package](https://pypi.org/project/optima35/) +can be installed with pip, dependencies will be installed automaticly. +```bash +pip install optima35 +``` ## Overview -**OPTIMA-35** (**Organizing, Processing, Tweaking Images, and Modifying scanned Analogs from 35mm Film**) is a Python-based project designed to streamline the management and editing of metadata and images from analog photography. While it was created with analog photography in mind, it is versatile enough to handle any type of images. +**OPTIMA35** (**Organizing, Processing, Tweaking Images, and Modifying scanned Analogs from 35mm Film**) is a Python-based project designed to streamline the management and editing of metadata and images from analog photography. While it was created with analog photography in mind, it is versatile enough to handle any type of images. This project replaces my earlier [analogphotography](https://gitlab.com/sf-bashscripts/analogphotography) bash script collection, which has now been archived in favor of OPTIMA-35. @@ -13,29 +15,28 @@ This project replaces my earlier [analogphotography](https://gitlab.com/sf-bashs ### Development and Versioning Notes -**OPTIMA-35** is currently in an **alpha stage** and under active development. As a result: +**OPTIMA35** is currently in an **alpha stage** and under active development. As a result: - The README may occasionally be outdated. -- Users are encouraged to check for new branches and read the [**CHANGELOG**](https://gitlab.com/CodeByMrFinchum/optima-35/-/blob/main/CHANGELOG.md?ref_type=heads), which is consistently updated and well-documented. +- Users are encouraged to check for new branches and read the [**CHANGELOG**](https://gitlab.com/CodeByMrFinchum/optima35/-/blob/main/CHANGELOG.md?ref_type=heads), which is consistently updated and well-documented. - Bugs or unforeseen behavior may occur. While the project follows a semantic versioning structure (major.minor.patch), breaking changes—typically reserved for major version increments—may also occur in minor version updates during this development phase. Please review the changelog carefully before updating. ### Available Features: -**Implemented Features:** -- **Image Processing:** - - Resizing - - Renaming with order adjustment - - Grayscale conversion - - Brightness adjustment - - Contrast adjustment -- **EXIF Management:** - - Copy EXIF data - - Add custom EXIF information - - Add GPS data - - Add a date to EXIF - - Remove EXIF -- **Watermarking** +**Image Processing:** +- Resizing +- Renaming with order adjustment +- Grayscale conversion +- Brightness adjustment +- Contrast adjustment +**EXIF Management:** +- Copy EXIF data +- Add custom EXIF information +- Add GPS data +- Add a date to EXIF +- Remove EXIF +**Watermarking** ## Dependencies @@ -43,15 +44,6 @@ While the project follows a semantic versioning structure (major.minor.patch), b - **piexif**: For reading, modifying, and writing EXIF metadata. - **pillow**: For image processing. -### Installing Dependencies - -You can install the dependencies using the requirements.txt - -Using `pip`: -```bash -pip install -r requirements.txt -``` - # Use of LLMs In the interest of transparency, I disclose that Generative AI (GAI) large language models (LLMs), including OpenAI’s ChatGPT and Ollama models (e.g., OpenCoder and Qwen2.5-coder), have been used to assist in this project. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9f07ed0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "optima35" +version = "0.6.3-a1" +authors = [{ name = "Mr. Finchum" }] +description = "OPTIMA35 is a package to modify images with pillow and piexif." +readme = "README.md" +requires-python = ">=3.8" +dependencies = ["piexif", "pillow"] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", + "Operating System :: OS Independent", +] + +[project.urls] +Homepage = "https://gitlab.com/CodeByMrFinchum/optima35" From cf256374efc2d9d1a038ed39f0e7a76338a695d5 Mon Sep 17 00:00:00 2001 From: CodeByMrFinchum Date: Fri, 3 Jan 2025 12:45:09 +0100 Subject: [PATCH 4/8] Adjusted README --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a850a1..c24243b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## 0.6.x +### 0.6.3a1 +- Adding postfix a to indicate alpha version, making it clear that it is in an early state + ### 0.6.2 - Version on pypi. - .1 and .2 have no change, but had to republish the file, which required to increase the version number. From f22ca680ca3bbc774223994abe32eebf2b56f574 Mon Sep 17 00:00:00 2001 From: CodeByMrFinchum Date: Fri, 3 Jan 2025 12:49:04 +0100 Subject: [PATCH 5/8] Oops forgot to update the version nr in core... --- src/optima35/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/optima35/core.py b/src/optima35/core.py index 5450f57..5db74e2 100644 --- a/src/optima35/core.py +++ b/src/optima35/core.py @@ -6,7 +6,7 @@ from optima35.image_handler import ImageProcessor, ExifHandler class OptimaManager: def __init__(self): self.name = "OPTIMA-35" - self.version = "0.6.0" + self.version = "0.6.3-a1" self.image_processor = ImageProcessor() self.exif_handler = ExifHandler() From d85c796dcc2a798fc701cf3e935d4461127eea20 Mon Sep 17 00:00:00 2001 From: CodeByMrFinchum Date: Fri, 3 Jan 2025 13:47:28 +0100 Subject: [PATCH 6/8] v0.6.3-a2, added __version__, version in pypi is now dynamic. --- CHANGELOG.md | 5 ++++- pyproject.toml | 11 ++++++++++- src/optima35/__init__.py | 1 + src/optima35/core.py | 5 +++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c24243b..b0dca39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ # Changelog ## 0.6.x -### 0.6.3a1 +### 0.6.3-a2 +- Adding __version__ to `__init__.py` so version is automaticly updated in program as well as pypi. + +### 0.6.3-a1 - Adding postfix a to indicate alpha version, making it clear that it is in an early state ### 0.6.2 diff --git a/pyproject.toml b/pyproject.toml index 9f07ed0..b6e50a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "optima35" -version = "0.6.3-a1" +dynamic = ["version"] authors = [{ name = "Mr. Finchum" }] description = "OPTIMA35 is a package to modify images with pillow and piexif." readme = "README.md" @@ -18,3 +18,12 @@ classifiers = [ [project.urls] Homepage = "https://gitlab.com/CodeByMrFinchum/optima35" + +[project.scripts] +optima35 = "optima35.__main__:main" + +[tool.hatch.build.targets.wheel] +packages = ["src/optima35"] + +[tool.hatch.version] +path = "src/optima35/__init__.py" diff --git a/src/optima35/__init__.py b/src/optima35/__init__.py index e69de29..ccaf771 100644 --- a/src/optima35/__init__.py +++ b/src/optima35/__init__.py @@ -0,0 +1 @@ +__version__ = "0.6.3-a2" diff --git a/src/optima35/core.py b/src/optima35/core.py index 5db74e2..e7e122e 100644 --- a/src/optima35/core.py +++ b/src/optima35/core.py @@ -2,11 +2,12 @@ import re import os from datetime import datetime from optima35.image_handler import ImageProcessor, ExifHandler +from optima35 import __version__ class OptimaManager: def __init__(self): - self.name = "OPTIMA-35" - self.version = "0.6.3-a1" + self.name = "OPTIMA35" + self.version = __version__ self.image_processor = ImageProcessor() self.exif_handler = ExifHandler() From 33e8334566b5c211134200439e03ec8980ffca37 Mon Sep 17 00:00:00 2001 From: CodeByMrFinchum Date: Fri, 3 Jan 2025 13:48:15 +0100 Subject: [PATCH 7/8] __main__ which is started if users starts optima35 without ui. --- src/optima35/__main__.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/optima35/__main__.py diff --git a/src/optima35/__main__.py b/src/optima35/__main__.py new file mode 100644 index 0000000..5eee31f --- /dev/null +++ b/src/optima35/__main__.py @@ -0,0 +1,8 @@ +from . import __version__ + +def main(): + print(f"optima35 (v{__version__}) is a core library and not intended to be run directly.") + print("Please use OptimaLab35 for a UI, run pip install OptimaLab35 and start with OptimaLab35.") + +if __name__ == "__main__": + main() From ca79e7c9449569fcb614604871c777f2a06b608e Mon Sep 17 00:00:00 2001 From: CodeByMrFinchum Date: Fri, 3 Jan 2025 13:51:18 +0100 Subject: [PATCH 8/8] fixed formation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index eaed8f8..d9b01d7 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,14 @@ While the project follows a semantic versioning structure (major.minor.patch), b - Grayscale conversion - Brightness adjustment - Contrast adjustment + **EXIF Management:** - Copy EXIF data - Add custom EXIF information - Add GPS data - Add a date to EXIF - Remove EXIF + **Watermarking** ## Dependencies