Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip "setuptools>=83" wheel
Expand Down
2 changes: 1 addition & 1 deletion Image_Processor_Pro_Summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ ImageProcessorMJWProject/
- **Pillow (PIL) 11.3.0** - Advanced image processing
- **OpenCV 4.12.0** - Computer vision operations
- **PyMuPDF 1.26.3** - PDF processing
- **CustomTkinter 5.2.2** - Modern GUI framework
- **CustomTkinter 6.0.0** - Modern GUI framework
- **Flask 3.1.1** - HTTP API server
- **Azure SDK** - Cloud integration
- **NumPy 2.2.6** - Numerical operations
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ version = "2.0.0"
description = "Local-first, fixity-aware MJW archive derivative renderer"
requires-python = ">=3.11"
dependencies = [
"Pillow==12.3.0",
"Pillow==13.0.0",
"PyYAML==6.0.3",
"loguru==0.7.3",
]

[project.optional-dependencies]
gui = ["customtkinter==5.2.2"]
pdf = ["PyMuPDF==1.28.0"]
gui = ["customtkinter==6.0.0"]
pdf = ["PyMuPDF==2.0"]
api = ["Flask==3.1.3"]
azure = ["azure-storage-blob==12.30.0", "azure-identity==1.25.1"]
vision-legacy = ["azure-cognitiveservices-vision-computervision==0.9.0"]
build = ["pyinstaller==6.19.0"]
dev = ["pytest==9.0.3", "pytest-cov==7.0.0", "pip-audit==2.10.0"]
azure = ["azure-storage-blob==12.31.0", "azure-identity==1.26.0"]
vision-legacy = ["azure-cognitiveservices-vision-computervision==0.9.1"]
build = ["pyinstaller==6.22.3"]
dev = ["pytest==9.1.1", "pytest-cov==7.1.0", "pip-audit==2.10.1"]

[tool.setuptools]
package-dir = {"" = "src"}
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Python >=3.11. Core + desktop UI. Optional capabilities use pyproject extras.
Pillow==12.3.0
Pillow==13.0.0
PyYAML==6.0.3
loguru==0.7.3
customtkinter==5.2.2
customtkinter==6.0.0
12 changes: 6 additions & 6 deletions src/image_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from PIL import Image, ImageCms, ImageDraw, ImageFont, ImageOps

try:
import fitz
import pymupdf
except ImportError: # PDF support is an explicit, separately licensed extra.
fitz = None
pymupdf = None


Path("logs").mkdir(exist_ok=True)
Expand Down Expand Up @@ -515,14 +515,14 @@ def _write_manifest(
if os.path.exists(temporary): os.unlink(temporary)

def _iter_pdf_pages(self, pdf_path: str) -> Iterator[Tuple[int, Image.Image]]:
if fitz is None:
if pymupdf is None:
raise RuntimeError("PDF support is not installed; install ImageProcessorPro with the 'pdf' extra")
path = Path(pdf_path)
self._source_ok(path)
document = fitz.open(path)
document = pymupdf.open(path)
try:
if document.page_count > self.config.max_pdf_pages: raise ValueError("PDF page count exceeds configured limit")
matrix = fitz.Matrix(self.config.pdf_dpi / 72, self.config.pdf_dpi / 72)
matrix = pymupdf.Matrix(self.config.pdf_dpi / 72, self.config.pdf_dpi / 72)
for number, page in enumerate(document, 1):
pixmap = page.get_pixmap(matrix=matrix, alpha=False)
if pixmap.width * pixmap.height > self.config.max_pixels: raise ValueError("PDF page exceeds pixel limit")
Expand Down Expand Up @@ -575,7 +575,7 @@ def save_optimized_image(self, image: Image.Image, output_path: str) -> None:

def get_image_files(self, folder_path: str) -> List[str]:
root_path = Path(folder_path); files: List[str] = []
supported = self.supported_formats if fitz is not None else self.supported_formats - {".pdf"}
supported = self.supported_formats if pymupdf is not None else self.supported_formats - {".pdf"}
for root, dirs, names in os.walk(root_path):
dirs[:] = [name for name in dirs if name.lower() != self.config.subfolder_name.lower()]
for name in names:
Expand Down
Loading