Can I upload SVG images as well?

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
velo
Posts: 44
Joined: 20 Jun 2016, 06:58

Can I upload SVG images as well?

Post by velo » 28 Jun 2016, 12:06

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)
Attachments
Screenshot from 2016-06-28 13-55-13.png
Screenshot from 2016-06-28 13-55-13.png (37.66 KiB) Viewed 3483 times

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Can I upload SVG images as well?

Post by aimeos » 28 Jun 2016, 17:06

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

velo
Posts: 44
Joined: 20 Jun 2016, 06:58

Re: Can I upload SVG images as well?

Post by velo » 06 Jul 2016, 12:42

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]

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Can I upload SVG images as well?

Post by aimeos » 06 Jul 2016, 22:03

Are you able to create a patch to extend the Media factory so image formats not supported by GD are returned as "application" objects?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

velo
Posts: 44
Joined: 20 Jun 2016, 06:58

Re: Can I upload SVG images as well?

Post by velo » 07 Jul 2016, 06:51

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]

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Can I upload SVG images as well?

Post by aimeos » 07 Jul 2016, 07:15

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

velo
Posts: 44
Joined: 20 Jun 2016, 06:58

Re: Can I upload SVG images as well?

Post by velo » 07 Jul 2016, 12:10

Shouldn't be much work. I try to implement it as soon as possible.

[pb]

velo
Posts: 44
Joined: 20 Jun 2016, 06:58

Re: Can I upload SVG images as well?

Post by velo » 13 Jul 2016, 08:34

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]

Post Reply