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

JIT recipes: Serve SVG as `image/svg+xml` #117

Closed jurajkapsz closed 8 years ago

jurajkapsz commented 8 years ago

Not sure what is the https://github.com/symphonycms/jit_image_manipulation/issues/109 issue talking all about, but when a SVG image is ran through a JIT recipe, the SVG image is returned with an octet-stream header, but browsers await an image/svg+xml to display SVG.

I guess this is served as it is with native php, probably here class.image.php#L172, but could this be tweaked? As it is no use as it is now, considering SVG images happening to go through a common recipe.

brendo commented 8 years ago

I'm curious, does JIT work as expected (aside from this) with SVG's? I would of thought there is fair bit that needs to change to enable SVG as PHP's image_ functions generally don't handle it?

jurajkapsz commented 8 years ago

I think only direct mode works with SVG, that is letting all the images through as they are; but SVG gets the octet mime header.

I am aware of this, I use in this particular case the direct mode, because I can have also SVG between images in this case.

I have solved this for now by using a real path to the images, but the mime type mentioned above is kind of wrong doing I would say, looks like straight from PHP functions as they are. Maybe it's from the past where browsers did not supported SVG rendering so much, so they were instructed to download it.

nitriques commented 8 years ago

We can't support this. SVG cannot be 'jitted'

Please use xsl to check if it's svg and do not pass them to jit.

I would of thought there is fair bit that needs to change to enable SVG as PHP's image_ functions generally don't handle it?

Yes, like, everything.