mariomitte 8e9d23fcfa
Some checks failed
ERP CI/CD Pipeline / test (push) Has been cancelled
ERP CI/CD Pipeline / Deploy (server git pull + compose) (push) Has been cancelled
fix: thumbnail-first + megapixel guard to prevent image OOM in PDF/DOCX
Previous draft()+convert()+thumbnail() ordering still caused OOM for
non-JPEG formats (PNG/HEIC) because draft() is a no-op for those formats,
and convert('RGB') forces a full pixel decode regardless.

Replace with thumbnail()-first ordering:
- thumbnail() internally calls draft() for JPEG before decoding
- thumbnail() performs in-place resize without allocating a second
  full-resolution buffer
- convert('RGB') is then called on the already-small image (safe for
  any format)

Add _COMPRESS_IMAGE_MAX_MEGAPIXELS guard (20 MP): read image dimensions
from headers only (no pixel decode) and return None for images that
exceed the limit. This prevents OOM even for pathologically large files
where draft() provides no benefit (e.g. PNG, TIFF, HEIC).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-31 10:10:01 +02:00

Frontend + Backend + Database + Deployment

Deploy na serveru

Nakon što je gitea webhook i testirana skripta za automatsko povlačenje promjena iz repozitorija

cd /opt/erp/app
git fetch origin
git reset --hard origin/main ili git pull --ff-only origin main

# rebuild backend + worker + beat + frontend
docker compose -f docker-compose.yml -f docker-compose.prod.yml build backend worker beat frontend

# digni servise s novim image-ima
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --force-recreate backend worker beat frontend

# OBAVEZNO migracije (scheduled_date)
docker compose -f docker-compose.yml -f docker-compose.prod.yml exec backend python manage.py migrate

# provjera
curl -i https://api-004.captain.mitteworkspace.cloud/api/health/
Description
Astro ERP + Django DRF, Celery, Redis aplikacija za Knez Ljubo
Readme 4 MiB
Languages
Python 51%
JavaScript 47.1%
TypeScript 0.8%
Astro 0.6%
CSS 0.3%