Issue
-
When an image is copy-pasted into the Web Content editor, it is stored as a base64 collection of characters.
-
What is the limit of this image? Are there any alternatives to this behavior?
Environment
- DXP 7.0
Resolution
- This behavior is expected because you are using the built-in web content editor that is called AlloyEditor, which is built on CKEditor. Since this is a third-party tool, copy-pasting is defined by the default behavior of CKEditor. Liferay supports different ways to add images, please see the available workarounds below.
- Storing image data in base64 has the advantages, but the image can lose its original size when embedding the image with copy & paste, and the maximum allowed image size in the editor is 256kB.
- Considering this limitation, please make sure to use the toolbar or drag & drop the image onto the field.
Additional Information
Please read further if you would like to know more about the current CKEditor behavior:
-
Drag and drop the image and save:
- The image data is interpreted into characters (base64).
- Our form-builder can handle the drag & drop function, and the image size is preserved.
-
Copy the image in image viewer and paste it in the HTML field and save:
- The image data is interpreted into characters.
- Our form-builder can't handle copying & pasting image, the size of the image is not preserved (567kB instead of 107kB).
- Upload the image using the toolbar and save: the image's original format is kept, as well as its size
- Using CKEditor: copying & pasting the image is not allowed.
- On our latest development version: this version uses CKEditor only, and this version no longer supports copy-pasting.