Django-optimize-image

Latest version: v0.1.1

Safety actively analyzes 723576 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.1

**Bump version to 0.1.1 for django-optimize-image package**
--

[Bump version to 0.1.1 for django-optimize-image package](https://github.com/nahom-d54/django-optimize-image/commit/7d4d73d49cedab6eb7e547ee0b1ad84fff1af1c5)

0.1.0

**What's New:**
- Introduced **Django middleware** to optimize image uploads automatically.
- Converts uploaded images to **WebP format**.
- Supports **dynamic configuration** via `settings.py` and allows **per-request overrides** using `request.META`.
- Includes a **standalone utility function** for manual optimization in views or forms.

**Features:**
- **Automatic image optimization** via middleware.
- **Dynamic per-request overrides** for image optimization (size, quality, etc.).
- **WebP format** support for optimized images.
- **Configurable defaults** for image width, height, and quality through `settings.py`.

**Installation:**
You can install the package via pip:

sh
pip install django-image-optimizer


**Usage:**
1. **Middleware Activation:** Add `optimizer_middleware.middleware.ImageOptimizationMiddleware` to your `MIDDLEWARE` in `settings.py`.
2. **Settings Configuration:** Configure default image width, height, and quality in `settings.py`.
3. **Manual Image Optimization:** Use the `optimize_image()` utility function anywhere in your Django project for custom image optimization.

**Future Plans:**
- Enhanced error handling and edge cases.
- Support for additional image formats (e.g., JPEG, PNG).
- More advanced optimization options and support for different image libraries.

---

Let me know if you want to adjust anything!

**Full Changelog**: https://github.com/nahom-d54/django-image-optimizer/commits/v0.1.0

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.