- Issue created by @henrik23
We in our agency would like to use svg images in a government project. But neither adding svg as an allowed image file format to media image nor creating a separate svg media type works. Unfortunately the module 'degov_auto_crop' public function calculateScaleFactor() runs in a division by zero error because $image_dimensions[0] is 0.
We added media type 'svg' and configured the form display of the so handled content field to "image" or "entity browser" not the cropping mode. But always degov_auto_crop interferes when uploading an image in the content editor.
We would appreciate if the function calculateScaleFactor() would start with proving if the $image_dimension[0] is greater than 0. Like this:
/**
* if $image_dimensions[0] is not available (for instance with svg images) don't try to calculate it and return 1
*/
if(!$image_dimensions[0]) return 1;
Alternatively we would like to know if there is a possibility to patch this behaviour using a composer patch. But unfortunately the module is part of a drupal profile and we don't know how to patch this or how to override it using a module.