django-cropperjs
Adds CropperJS’s functionality to image fields in Django/Django CMS admin, including inlines.
CropperImageField is a subclass from ImageField, and so can be interchanged in your existing base without data loss.
Quick start
Add “cropperjs” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...
'cropperjs',
]
Change/set your model’s image field to use CropperImageField instead of ImageField.
from cropperjs.models import CropperImageField image_field = CropperImageField(...)
Field options
All options from ImageField are (or should be) usable, like upload_to. These below allow you to customize some of the CropperJS component behavior on a field-to-field basis:
aspectratio: float
Suggests (as in, can be overriden later at client-side if needed) a fixed proportion for the Cropper component, e.g. 1.7777 (16:9).
dimensions: tuple(int, int)
Defines a fixed dimension for the image generated. When informed, calculates and overrides aspectratio.
linked: bool
Linked Cropper fields are called consecutively after any other in the same context (outside inlines, inline groups) is saved, using the same original image specified by the user. Useful when the user needs the same image but in different ways/sizes, e.g. a main image and a 1:1 thumbnail.
Metadata
Release files for django-cropperjs 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-cropperjs-0.0.5.tar.gz | 26.2 kB | Without provenance | Details for django-cropperjs-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_cropperjs-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for django_cropperjs-0.0.5-py3-none-any.whl |
Total release size: 55.1 kB
Release files / django-cropperjs-0.0.5.tar.gz
| Download URL | django-cropperjs-0.0.5.tar.gz |
|---|---|
| Size | 26.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b1a301d0840999f51a43750897514252878e91a98a9a85c0cb54103e28e38f0
|
|
BLAKE2b-256 checksum How to use checksums |
ebde50648309a494e471a1486279fce51308e8913a10fb9f7ec29dabd1ceb0ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.12
|
Release files / django_cropperjs-0.0.5-py3-none-any.whl
| Download URL | django_cropperjs-0.0.5-py3-none-any.whl |
|---|---|
| Size | 28.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b98d00492483490106e2ae1980f1b9e736ac5c9b0469bd58de2b42fd510312c3
|
|
BLAKE2b-256 checksum How to use checksums |
46551f1bc05226b4deb9ae89c75db3431171f4559b1a507e0d6cc96cf06d44a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.12
|
Security for django-cropperjs 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.