{"id":13724973,"url":"https://github.com/un1t/django-resized","last_synced_at":"2025-05-16T07:03:22.911Z","repository":{"id":4283770,"uuid":"5413179","full_name":"un1t/django-resized","owner":"un1t","description":"Resizes image original to specified size. Compatible with sorl-thumbnail","archived":false,"fork":false,"pushed_at":"2024-10-14T06:11:10.000Z","size":238,"stargazers_count":266,"open_issues_count":11,"forks_count":49,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T22:39:21.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/un1t.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-08-14T13:27:02.000Z","updated_at":"2025-03-23T22:20:14.000Z","dependencies_parsed_at":"2024-03-18T09:59:50.396Z","dependency_job_id":"12a4921c-75a0-479c-9799-29ca59883141","html_url":"https://github.com/un1t/django-resized","commit_stats":{"total_commits":105,"total_committers":20,"mean_commits":5.25,"dds":0.6190476190476191,"last_synced_commit":"4e4f50dbec361ff1d65c5267d56a4fae3d4011a0"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un1t%2Fdjango-resized","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un1t%2Fdjango-resized/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un1t%2Fdjango-resized/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un1t%2Fdjango-resized/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/un1t","download_url":"https://codeload.github.com/un1t/django-resized/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254484978,"owners_count":22078761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:02:08.465Z","updated_at":"2025-05-16T07:03:22.860Z","avatar_url":"https://github.com/un1t.png","language":"Python","readme":".. image:: https://github.com/un1t/django-resized/actions/workflows/python-app.yml/badge.svg\n    :target: https://github.com/un1t/django-resized/actions/workflows/python-app.yml\n\nResizes image origin to specified size. Compatible with sorl-thumbnail. Inherits from ImageField.\n\nFeatures\n========\n\n- Tested on Django 3.2, 4.0, 4.1, 4.2, 5.0, 5.1\n\nInstallation\n============\n\n.. code-block:: bash\n\n    pip install django-resized\n\n\nConfiguration (optional)\n========================\n\nsettings.py\n\n.. code-block:: python\n\n    DJANGORESIZED_DEFAULT_SIZE = [1920, 1080]\n    DJANGORESIZED_DEFAULT_SCALE = 0.5\n    DJANGORESIZED_DEFAULT_QUALITY = 75\n    DJANGORESIZED_DEFAULT_KEEP_META = True\n    DJANGORESIZED_DEFAULT_FORCE_FORMAT = 'JPEG'\n    DJANGORESIZED_DEFAULT_FORMAT_EXTENSIONS = {'JPEG': \".jpg\"}\n    DJANGORESIZED_DEFAULT_NORMALIZE_ROTATION = True\n\n\nUsage\n=====\n\nmodels.py\n\n.. code-block:: python\n\n    from django_resized import ResizedImageField\n\n    class MyModel(models.Model):\n        ...\n        image1 = ResizedImageField(size=[500, 300], upload_to='whatever')\n        image2 = ResizedImageField(size=[100, 100], crop=['top', 'left'], upload_to='whatever')\n        image3 = ResizedImageField(size=[100, 150], crop=['middle', 'center'], upload_to='whatever')\n        image4 = ResizedImageField(scale=0.5, quality=75, upload_to='whatever')\n        image5 = ResizedImageField(size=None, upload_to='whatever', force_format='PNG')\n        image6 = ResizedImageField(size=[100, None], upload_to='whatever')\n\nOptions\n-------\n\n\n- **size** - max width and height, for example [640, 480]. If a dimension is None, it will resized using the other value and maintains the ratio of the image. If size is None, the original size of the image will be kept.\n- **scale** - a float, if not None, which will rescale the image after the image has been resized.\n- **crop** - resize and crop. ['top', 'left'] - top left corner, ['middle', 'center'] is center cropping, ['bottom', 'right'] - crop right bottom corner.\n- **quality** - quality of resized image 0..100, -1 means default\n- **keep_meta** - keep EXIF and other meta data, default True\n- **force_format** - force the format of the resized image, available formats are the one supported by `pillow \u003chttps://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#image-file-formats\u003e`_, default to None\n\n\nHow to run tests\n================\n\n.. code-block:: bash\n\n    pip install tox\n    tox\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun1t%2Fdjango-resized","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fun1t%2Fdjango-resized","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun1t%2Fdjango-resized/lists"}