symphonycms / jit_image_manipulation

Just in Time Image Manipulation for Symphony CMS
http://symphonyextensions.com/extensions/jit_image_manipulation/
Other
25 stars 42 forks source link

Suggestion: handling SVG images #109

Open animaux opened 9 years ago

animaux commented 9 years ago

When an SVG-Image is sent to JIT it currently doesn’t do anything useful. Maybe JIT should just pass through the original SVG if it detects one?

nitriques commented 9 years ago

Hum... I've implemented something similar here and it creates lots of if else clause...

I really think that the supporting svg (just by "letting it pass through") is not a responsibility of this extension.

A simple xsl choose should be enough (we even have a xsl template that properly handles it).

I'd love to here what @brendo thinks about this.

animaux commented 9 years ago

A simple xsl choose should be enough (we even have a xsl template that properly handles it).

That’s what I did in the meantime. Maybe you’re right.

nitriques commented 9 years ago

Maybe you’re right.

But maybe I am not ;) But adding svg support would add a lot of complexity (if ... else ...) to the current code base. If we would refactor the code base to use the strategy pattern (one class for each mime type), it would not add a lot of complexity. But the current code base must be re-written for that.

animaux commented 9 years ago

I see. Thanks for the inside info :)

nitriques commented 9 years ago

My pleasure. I love to talk about those things :)

animaux commented 9 years ago

:)

I tried to think about the implications of applying JIT to SVG. I wonder if there are any libraries around?

nitriques commented 9 years ago

I wonder if there are any libraries around?

I do not know! Would be cool to be able to crop it! But you would not really save on bandwidth tho.

animaux commented 9 years ago

Thinking further most use-cases of SVG that come to mind will not be the kind of images one would like to be cropped … but then again who knows? Good to have all the possibilities :)

nitriques commented 9 years ago

Yup.