Feature Suggestion: never crop SVG files

Cropping does not work on SVG files (and I don’t expect it to), but if the user uses the cropping tool, it creates a broken link to an empty file.

To prevent this: In fields where both bitmaps and SVG are accepted, the cropping tool should not be activated for SVGs and all [[+crop.XXX.url]] fields should use the original url of that file so that the output is still valid (at least if the SVG file is suitable for that).

Thoughts?

How do you think it should handle the “region of interest” aspect of cropping when using SVGs, i.e. select the area of an image to use?

MoreGallery handles SVGs by creating a png of it which be another option to consider. That way you get all the benefits of the cropping, but potentially larger images.

As a minimal solution it would be sufficient in most cases to just don’t show the cropper for SVGs and fill all placeholders only with the url to the full svg-file.

But If there was an option to convert the SVG to PNG in the case that a user wishes to use it: perfect! Would be very flexible. If the user does not need a region of interest, it should always be used as-is.

So: 3 cases:

  1. user uploads bitmap: cropping as usual
  2. user uploads SVG and wants full image: insert as-is
  3. user uploads SVG and wishes to crop: render as a cropped PNG

(I can imagine that this render-cropping can be tricky: Many SVGs have a fixed height and width and don’t render in full size. I found that it’s best in most cases to just remove any size attributes. There are also cases where there are elements outside the viewport, etc.)

1 Like