Troubleshooting¶
Images are still resized on the server¶
After the upload, the message "The image was resized to fit within the maximum allowed dimensions" means the server resized the image. Check that:
- Reports » Status report shows Image Compressor: Compressor.js as installed. See Installation.
- The field has Maximum image dimensions set.
- The form uses core's Image widget, a widget built on it, the Media Library's upload form, or a
managed_fileelement with aFileImageDimensionsvalidator. - The file is a JPEG, PNG or WebP image. Other types are left to the server.
- The
image_compressor/codelibrary is on the page, and the browser console shows no errors.
Compressor.js is installed but not found¶
The module looks for compressorjs/dist/compressor.min.js in sites/<site>/libraries, the web root's libraries and the install profile's libraries directory. Composer's Asset Packagist install puts it in web/libraries/compressorjs. Rebuild caches after adding it.
Media Library uploads are not resized¶
The Media Library reads the maximum from the media type's source field. Check that the media type's source is Image and that its image field has Maximum image dimensions set.
The upload starts a moment after the file is chosen¶
Decoding and resizing a large photo takes time, about a second for a 24-megapixel JPEG in desktop Chrome and longer on phones. While it runs, the file input is disabled and a throbber with "Resizing image…" is shown after it. The upload starts, with core's own progress indicator, when every chosen file is processed.
Other file fields stopped uploading¶
Versions before the fix for #3578243 replaced core's automatic upload for every file input on the page. Update the module.
A resized image looks soft¶
JPEG and WebP images are encoded at quality 0.8. To change it, see Extending.