The image editor
Exponential has an image editor inside the edit form. When you edit an item with an image field, you can crop, rotate, flip and resize the image, change its brightness and contrast, make it black and white or sepia, pixelate or blur a part of it, and add a watermark, without leaving the administration. SVG drawings can be edited too, and an empty image field can start a new drawing.
In the edit form, Edit image next to the stored image opens the image editor.
Two editors, one for each kind of administration
| Administration design | Image editor |
|---|---|
| Admin 4 (and Admin 4 with layouts) | expimageeditor, added in Exponential 6.0.15. It opens in a window over the edit form, works without jQuery and follows the light and dark color mode. |
| The classic admin designs | ezie, the image editor of earlier releases, repaired for current PHP and jQuery in the 6.0 releases. |
Only one of the two can be active on a site, because both draw the same button in the image field. A new installation made with the setup wizard or the kickstarter activates expimageeditor.
Your changes stay in your draft
The editor works on the image of your draft. Save stores the result as the image of the draft, and the form shows the new image at once. The published version keeps its own image until you publish the draft. Cancel leaves the draft as it was. See Editing an image for the tools.
The image editor: the tools at the top, the image in the middle, the settings of the current tool on the right, Cancel and Save at the bottom.
Setting it up
For administrators. expimageeditor ships with Exponential, inside the kernel's repository, and is off until it is activated.
- In settings/override/site.ini.append.php, add ActiveExtensions[]=expimageeditor under [ExtensionSettings], and remove or comment out ActiveExtensions[]=ezie.
- Give editors the policy expimageeditor/edit in their role. Administrators with all rights have it. Without it the Edit image button is not shown.
- Regenerate the autoloads and clear the caches.
[ExtensionSettings] #ActiveExtensions[]=ezie ActiveExtensions[]=expimageeditor
php bin/php/ezpgenerateautoloads.php -e php bin/php/ezcache.php --clear-tag=ini php bin/php/ezcache.php --clear-tag=template
Requirements: an admin design of Admin 4, the form token extension ezformtoken (the save request carries the form token), GD on the server (a saved raster image is decoded and written anew, so only its pixels are stored) and a current browser. Its settings are in expimageeditor.ini [EditorSettings]: the types it may store, the JPEG and WebP quality, the largest image (25 megapixels, 20 MB), the size of a new drawing, the crop ratios, the watermark images and the fonts.
ezie is installed with Exponential as well. To use it in the classic admin designs, activate ezie instead of expimageeditor. It needs GD2 or ImageMagick and the Zeta Components image conversion.
What can go wrong
- There is no Edit image button. Your role lacks expimageeditor/edit, the field holds no image yet (then New SVG drawing may appear instead), or your administration design is not Admin 4.
- Save is refused. The message names the reason: the image is too large, its type may not be stored, or the draft is not yours. An SVG stays an SVG and a raster image stays a raster image.
- A GIF came back as a PNG. GIF is not among the shipped output types, so it is saved as PNG and an animation is lost.
Read more
- Editing an image
- Adding custom watermarks
- Images, media and uploads, in the help center.
In this section
- Installation This topic has moved to The image editor, section Setting it up.
- Adding custom watermarks Adding a watermark to an image in Exponential 6, and offering custom watermark images in expimageeditor and ezie.
- Editing an image The tools of the Admin 4 image editor in Exponential 6: crop, rotate, flip, resize, filters, watermark, keyboard shortcuts and SVG drawings.
- Keyboard shortcuts This topic has moved to Editing an image, which lists the keyboard shortcuts of the image editor.
- Requirements This topic has moved to The image editor, section Setting it up.
Contributors
- Ricardo Correia
- Graham Brookins Updated Maintainer
Comments
Add a comment