Page 1 of 1

Can I upload SVG images as well?

Posted: 28 Jun 2016, 12:06
by velo
Hi,

we are using TYPO3 7.6 and Aimeos 16.4.3. We want to use SVG images for some icons in our attributes (Product/Attribute/Media). We are getting an error when we try to upload a SVG file.

Can we use SVG images somehow? Can we enable the upload of SVG images in the backend?

Thanks in advance!

(dg)

Re: Can I upload SVG images as well?

Posted: 28 Jun 2016, 17:06
by aimeos
You can try to alter the allowed image types:
https://aimeos.org/docs/Configuration/C ... lowedtypes

Maybe you have to set the configuration to NULL but I'm unsure how this is done with TypoScript. In PHP configuration file placed in an extension, this is possible.

Re: Can I upload SVG images as well?

Posted: 06 Jul 2016, 12:42
by velo
Hey there,

the correct configuration to add more imagetypes in typoscript looks like this

Code: Select all

plugin.tx_aimeos.settings.controller.common.media.standard.files.allowedtypes{
	0 = image/[someSUPPORTEDimageType]
}
BUT there's a major problem with image/svg+xml, aimeos uses gdlib which doesn't support svg. So adding svg as allowed type doesn't help here. The error message above isn't about allowed image types in aimeos, it says the underlying image lib doesn't support svg.
I'll try to fix the Message to something like "the image lib doesnt support the image type, supported types are ...." and make a pull request.

Greetings [pb]

Re: Can I upload SVG images as well?

Posted: 06 Jul 2016, 22:03
by aimeos
Are you able to create a patch to extend the Media factory so image formats not supported by GD are returned as "application" objects?

Re: Can I upload SVG images as well?

Posted: 07 Jul 2016, 06:51
by velo
Hi,

I think a good idea would be to make it possible to use graphicsmagick (gm) for all the image stuff. It's more stable and much more formats are supported as you can see in this list: http://www.graphicsmagick.org/formats.html

Idea: Make this configurable so one can choose between gd and gm. So if you're okay with gd just do nothing but if you need support for more image types configure aimeos to use gm.

I'll take a look into the code to see what has to be done. I can't promise to release such a change. It depends on the time I have to invest.

regards
[pb]

Re: Can I upload SVG images as well?

Posted: 07 Jul 2016, 07:15
by aimeos
That's a good idea. Are you able to create an alternative Implementation \Aimeos\MW\Media\Image\Gmagik class to support Gmagick? We would care about making it configurable.

Re: Can I upload SVG images as well?

Posted: 07 Jul 2016, 12:10
by velo
Shouldn't be much work. I try to implement it as soon as possible.

[pb]

Re: Can I upload SVG images as well?

Posted: 13 Jul 2016, 08:34
by velo
Just for Information.
I'll take a look at this and implement a solution with gm(graphics magick) or im (image magick).
But for now there is so much work to do for me, so this project has to wait a little.
Sorry [pb]