-
-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for SVG images #879
Comments
I haven’t tried it myself but it looks like the external imagesharp component can’t handle svg images. I’ll take a look at if there’s any updates on their library or if maybe skiasharp handles svg. |
I don't see why SVGs should be handled by the image cropper - most browsers are able to render them just fine in any resolution. |
I’ll have check the code why it’s failing. My guess is that the content is added as an image so it uses the current image component to verify that it is an image which fails. We would probably need to extend the registration of image types so you can specify if it should be cropped or not. |
So the problem is the following line in the code. When an image is uploaded it tries to create an Image object from it to get the dimensions of it:
As |
This will be release in Piranha.App.MediaTypes.Images.Add(".svg", "image/svg+xml", false); All calls for getting a resized version of the image will return the original URL. |
where do you put this line of code? |
In the Regards |
it keep saying Failed to upload media. Image cannot be loaded. Available decoders:
|
Which version are you using of Piranha? I haven't tested this for a while, I'll have to double-check so that our external dependency |
Piranha 8.4.1 |
@kttary Can you verify that you have set the third optional parameter to Piranha.App.MediaTypes.Images.Add(".svg", "image/svg+xml", false); If not the file will be opened with |
Yes i follow your comment on oct 28 2019. |
I can't reproduce your issue. I have done the following.
The file uploads correctly and I can open it and look at the details and preview (see screenshot). The file used for testing was downloaded here: |
Got it work now. Problem with my browser i think |
I've added SVG as an image type but the manager will not let me upload it. Is there a way around this?
The text was updated successfully, but these errors were encountered: