django-imageit


Namedjango-imageit JSON
Version 0.0.8 PyPI version JSON
download
home_pagehttps://github.com/byite/django-imageit
SummaryImage upload & processing plugin built for Django
upload_time2023-05-30 11:22:57
maintainer
docs_urlNone
authorScott James
requires_python
license
keywords django images imageit image upload scale crop resize
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ================
Django ImageIt
================

|PyPi_Version| |PyPi_Status| |Format| |python_versions| |django_versions| |License|

Django ImageIt is a simple image handling plugin for Django that allows for scaling, upscaling and cropping of raster images. Imageit also has the capability to accept svg files if required.

Key features
============

* Preview current image and new image selected for upload.
* Scale images to fit the bounds of max_width and max_height.
* Crop images to user defined dimensions before being scaled.
* Option to upscale smaller images.
* Utilises cropper.js.
* Accepts .svg images.
* Django Admin support.


Usage
============
* Install django-imageit using pip
    .. code-block:: shell

        pip install django-imageit


* Add 'imageit' to INSTALLED_APPS in your settings.py
    .. code-block:: python

        INSTALLED_APPS = [
            ...
            'imageit',
            ...
        ]


* Import Imageit model fields to use them in your models.
    .. code-block:: python

        from imageit.models import ScaleItImageField, CropItImageField

        class ImageItModel(models.Model):
            scale_image = ScaleItImageField(max_width=100, max_height=100, quality=100, null=True, blank=True)
            crop_image = ScaleItImageField(max_width=1000, max_height=1000, quality=100, null=True, blank=True)

* Available Imageit field KWARGS
    * **max_width (int)**: Image will be scaled to the bounds of max_width in pixels (while retaining aspect ratio)
    * **max_height (int)**: Image will be scaled to the bounds of max_height in pixels (while retaining aspect ratio)
    * **quality (int)**: Quality in dpi of resampled images
    * **max_save_size (int)**: Max size (mb) permitted for images after scaling/ resampling
    * **upscale (bool)**: Upscale images to the value of max_width/max_height?

    .. note:: Imageit fields inherit from the existing Django `FileField <https://docs.djangoproject.com/en/3.2/ref/models/fields/#filefield>`_. Therefore FileField arguments are also accepted (such as upload_to).


Options
============
Imageit provides many options to tailor functionality specifically for your use case. While specific dimensions for scaling can be set as arguments on a field-by-field basis, Imageit also allows for project wide defaults to be set if no value is provided at the field level.

Imageit will default to 100dpi quality at maximum dimensions of 1000x1000, If you wish to use your own custom defaults, you can do so in your settings.py as follows.

**Settings overrides**
.. code-block:: python

    IMAGEIT_MAX_UPLOAD_SIZE_MB = 5
    IMAGEIT_MAX_SAVE_SIZE_MB = 5
    IMAGEIT_DEFAULT_IMAGE_PROPS = {"max_width": 1000, "max_height": 1000, "quality": 100, "upscale": False}
    IMAGEIT_ACCEPTED_CONTENT_TYPES = 'image/jpeg', 'image/png', 'image/svg+xml'
    IMAGEIT_SVG_CONTENT_TYPE = 'image/svg+xml'

* **IMAGEIT_MAX_UPLOAD_SIZE_MB** is provided in MB, and is validated on the client side as well as on the server before cropping/scaling.

* **IMAGEIT_MAX_SAVE_SIZE_MB** is provided in MB, and is validated on the server after and scaling/cropping/resampling is completed.

* **IMAGEIT_DEFAULT_IMAGE_PROPS** Default properties used to scale/resample images

* **IMAGEIT_ACCEPTED_CONTENT_TYPES** Content types accepted by imageit. (File mimes are validated by 3rd party FileTypes package)

.. warning:: It is not reccomended to allow svg file uploads to untrusted users. Imageit will allow upload of svg images if specified in your accepted content types. It must be noted that while Imageit completes checks for scripts in svg files, no guarantee of security from XSS attacks is provided. 



.. _Django: https://www.djangoproject.com

.. |PyPi_Version| image:: https://img.shields.io/pypi/v/django-imageit.svg
.. |PyPi_Status| image:: https://img.shields.io/pypi/status/django-imageit.svg
.. |Format| image:: https://img.shields.io/pypi/format/django-imageit.svg
.. |python_versions| image:: https://img.shields.io/pypi/pyversions/django-imageit.svg
.. |django_versions| image:: https://img.shields.io/badge/Django-3.0,%203.1,%203.2-green.svg
.. |License| image:: https://img.shields.io/pypi/l/django-imageit.svg


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/byite/django-imageit",
    "name": "django-imageit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django images imageit image upload scale crop resize",
    "author": "Scott James",
    "author_email": "scottjames@byitegroup.com",
    "download_url": "https://files.pythonhosted.org/packages/5b/1b/07ad0a7de69c5612efcc1fa3aed1175f70ebf00c48e76ca2569d243dd4e0/django-imageit-0.0.8.tar.gz",
    "platform": null,
    "description": "================\nDjango ImageIt\n================\n\n|PyPi_Version| |PyPi_Status| |Format| |python_versions| |django_versions| |License|\n\nDjango ImageIt is a simple image handling plugin for Django that allows for scaling, upscaling and cropping of raster images. Imageit also has the capability to accept svg files if required.\n\nKey features\n============\n\n* Preview current image and new image selected for upload.\n* Scale images to fit the bounds of max_width and max_height.\n* Crop images to user defined dimensions before being scaled.\n* Option to upscale smaller images.\n* Utilises cropper.js.\n* Accepts .svg images.\n* Django Admin support.\n\n\nUsage\n============\n* Install django-imageit using pip\n    .. code-block:: shell\n\n        pip install django-imageit\n\n\n* Add 'imageit' to INSTALLED_APPS in your settings.py\n    .. code-block:: python\n\n        INSTALLED_APPS = [\n            ...\n            'imageit',\n            ...\n        ]\n\n\n* Import Imageit model fields to use them in your models.\n    .. code-block:: python\n\n        from imageit.models import ScaleItImageField, CropItImageField\n\n        class ImageItModel(models.Model):\n            scale_image = ScaleItImageField(max_width=100, max_height=100, quality=100, null=True, blank=True)\n            crop_image = ScaleItImageField(max_width=1000, max_height=1000, quality=100, null=True, blank=True)\n\n* Available Imageit field KWARGS\n    * **max_width (int)**: Image will be scaled to the bounds of max_width in pixels (while retaining aspect ratio)\n    * **max_height (int)**: Image will be scaled to the bounds of max_height in pixels (while retaining aspect ratio)\n    * **quality (int)**: Quality in dpi of resampled images\n    * **max_save_size (int)**: Max size (mb) permitted for images after scaling/ resampling\n    * **upscale (bool)**: Upscale images to the value of max_width/max_height?\n\n    .. note:: Imageit fields inherit from the existing Django `FileField <https://docs.djangoproject.com/en/3.2/ref/models/fields/#filefield>`_. Therefore FileField arguments are also accepted (such as upload_to).\n\n\nOptions\n============\nImageit provides many options to tailor functionality specifically for your use case. While specific dimensions for scaling can be set as arguments on a field-by-field basis, Imageit also allows for project wide defaults to be set if no value is provided at the field level.\n\nImageit will default to 100dpi quality at maximum dimensions of 1000x1000, If you wish to use your own custom defaults, you can do so in your settings.py as follows.\n\n**Settings overrides**\n.. code-block:: python\n\n    IMAGEIT_MAX_UPLOAD_SIZE_MB = 5\n    IMAGEIT_MAX_SAVE_SIZE_MB = 5\n    IMAGEIT_DEFAULT_IMAGE_PROPS = {\"max_width\": 1000, \"max_height\": 1000, \"quality\": 100, \"upscale\": False}\n    IMAGEIT_ACCEPTED_CONTENT_TYPES = 'image/jpeg', 'image/png', 'image/svg+xml'\n    IMAGEIT_SVG_CONTENT_TYPE = 'image/svg+xml'\n\n* **IMAGEIT_MAX_UPLOAD_SIZE_MB** is provided in MB, and is validated on the client side as well as on the server before cropping/scaling.\n\n* **IMAGEIT_MAX_SAVE_SIZE_MB** is provided in MB, and is validated on the server after and scaling/cropping/resampling is completed.\n\n* **IMAGEIT_DEFAULT_IMAGE_PROPS** Default properties used to scale/resample images\n\n* **IMAGEIT_ACCEPTED_CONTENT_TYPES** Content types accepted by imageit. (File mimes are validated by 3rd party FileTypes package)\n\n.. warning:: It is not reccomended to allow svg file uploads to untrusted users. Imageit will allow upload of svg images if specified in your accepted content types. It must be noted that while Imageit completes checks for scripts in svg files, no guarantee of security from XSS attacks is provided. \n\n\n\n.. _Django: https://www.djangoproject.com\n\n.. |PyPi_Version| image:: https://img.shields.io/pypi/v/django-imageit.svg\n.. |PyPi_Status| image:: https://img.shields.io/pypi/status/django-imageit.svg\n.. |Format| image:: https://img.shields.io/pypi/format/django-imageit.svg\n.. |python_versions| image:: https://img.shields.io/pypi/pyversions/django-imageit.svg\n.. |django_versions| image:: https://img.shields.io/badge/Django-3.0,%203.1,%203.2-green.svg\n.. |License| image:: https://img.shields.io/pypi/l/django-imageit.svg\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Image upload & processing plugin built for Django",
    "version": "0.0.8",
    "project_urls": {
        "Homepage": "https://github.com/byite/django-imageit"
    },
    "split_keywords": [
        "django",
        "images",
        "imageit",
        "image",
        "upload",
        "scale",
        "crop",
        "resize"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c4b5095d21832be1a0b1109158455eae0cfc2af85b7194cea211654b06dec521",
                "md5": "a204e5cd7c414f5e14e6cac2e1ae7e4c",
                "sha256": "98565419fb669acc997c4fe9ba6e45ca7b42eb8691059d78eb19183978a92535"
            },
            "downloads": -1,
            "filename": "django_imageit-0.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a204e5cd7c414f5e14e6cac2e1ae7e4c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 30608,
            "upload_time": "2023-05-30T11:22:55",
            "upload_time_iso_8601": "2023-05-30T11:22:55.892990Z",
            "url": "https://files.pythonhosted.org/packages/c4/b5/095d21832be1a0b1109158455eae0cfc2af85b7194cea211654b06dec521/django_imageit-0.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5b1b07ad0a7de69c5612efcc1fa3aed1175f70ebf00c48e76ca2569d243dd4e0",
                "md5": "d7d837a6dd71ea5156d5f88488480452",
                "sha256": "e65a783e8dacf3288501103a7085505f80fa4ef508244be26f31ed3e640e08dd"
            },
            "downloads": -1,
            "filename": "django-imageit-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "d7d837a6dd71ea5156d5f88488480452",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 28464,
            "upload_time": "2023-05-30T11:22:57",
            "upload_time_iso_8601": "2023-05-30T11:22:57.257130Z",
            "url": "https://files.pythonhosted.org/packages/5b/1b/07ad0a7de69c5612efcc1fa3aed1175f70ebf00c48e76ca2569d243dd4e0/django-imageit-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-30 11:22:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "byite",
    "github_project": "django-imageit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "django-imageit"
}
        
Elapsed time: 0.07040s