-
Notifications
You must be signed in to change notification settings - Fork 207
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
Need svg support #303
Comments
Also it would be nice if there was some kind of error message when you try and load an unsupported file type. |
If you read the readme, you'll find that there's an output that does exactly that. The problem with an svg is that it doesn't always have a width and height. The width and height need to be set on the svg tag itself else it will not render correctly. You can try it here: https://image-cropper.stackblitz.io. I changed it so svg is allowed there. |
What if when someone puts in an svg without width and height information you set the size using the resizeToWidth and resizeToHeight parameters? And if resizeToWidth and resizeToHeight are not set use an arbitrary default. |
Or even the width of the container |
It's possible to edit svgs in javascript. If that's not an option I think an acceptable fallback would be to convert it to png and use the png in the cropper. |
Using resizeToWidth is used for the resulting image, so you'll lose a lot of quality if you do that. |
@Mawi137 , i have try to upload an svg file in this domain: https://image-cropper.stackblitz.io, althought i have set the witdh and height to svg tag, so it doesn't work, plesea help me! thanks |
@Mawi137 https://image-cropper.stackblitz.io demo is not support for svg which has width attr |
for anyone looking into this in the future: with --> basically taking the height and width from the view box property as a fallback. @Mawi137 do you think something similar would be an option in the codebase itself? If so, I would make a proposal PR. |
@Mawi137 try to fix the SVG for image cropper, but did not get proper solution ? Is it fixed ? if yes I dont see the code changes for SVG format, Can you suggest me the solution if fixed.. |
The cropper doesn't load svgs.
The text was updated successfully, but these errors were encountered: