This package allows automatic scaling of too large images in Plone sites. Images can be either Image content type or any Image field on content types.
This is totally transparent to the user (except if you choose to show message).
There is also a view (@@resize-images) that you can call to scale existing images (under the context of your choice), for example:
- http://localhost:8080/plone/@@resize-images
- http://localhost:8080/plone/folder/subfolder/@@resize-images
- Enable automatic scaling (yes / no)
- Maximum height at which images will be automatically resized (in pixels)
- Maximum width at which images will be automatically resized (in pixels)
- JPEG quality
- Show information message to user when images have been resized (yes / no)
- You configure collective.autoscaling to have images with maximum size of height 800px / width 1200px.
- One of your user uploads a really big image: height 2000px / width 4000px.
- This image will be resized to height 600px / width 1200px (aspect ratio is of course preserved).
This add-on works only with Dexterity content types.
Version 2.x supports Plone 6.1 on Python 3.10 to 3.13, and Plone 6.2 on Python 3.10 to 3.14. For Plone 4.3 to 6.0, use collective.autoscaling 1.x.
This product has been translated into
- English
- French
- Norwegian
- Portuguese
Add collective.autoscaling to the dependencies of your project
(pyproject.toml, or requirements.txt with the Plone constraints), install it,
restart Plone and activate the add-on in Site Setup > Add-ons.
Requires uv. This installs Plone 6.2.3 in .venv
(use PLONE_VERSION=6.1.6 make install for another version) and the prek git hook:
make install
make start # Plone on http://localhost:8080 (admin / admin)Create a Classic UI site from the browser, then activate collective.autoscaling.
Tests run through tox, as the CI does. The robot scenarios run in headless
Chrome, which must be installed (Node.js too, for rfbrowser init):
make test # Plone 6.2.3
uvx --with tox-uv tox -e py312-plone61 # one Plone / Python combination
make test-all # lint, every combination, dependenciesIntegration tests only, without tox:
.venv/bin/zope-testrunner --test-path=src -s collective.autoscalingmake check # format then lint (pyupgrade, isort, black, zpretty, flake8...).editorconfig, .flake8, .gitignore, .pre-commit-config.yaml, tox.ini,
.github/ and the tool sections of pyproject.toml are generated by
plone.meta: change .meta.toml, then run
uvx --from plone.meta config-package --no-commit --branch current ..
- Issue Tracker: https://github.com/collective/collective.autoscaling/issues
- Source Code: https://github.com/collective/collective.autoscaling
The project is licensed under the GPLv2.