Jump to content

Svg uploads get stuck at 100%


Max Esnée
 Share

Recommended Posts

Hi,

When I upload a large(ish) SVG (≈120ko in this case) into an image field, it tends to get stuck at 100% and block the whole website. If I force refresh the admin page, the svg has not been uploaded. The file is correctly copied into the assets folder though. Other svg tends to be uploaded fine albeit I've noticed that pages containing svg images in the admin are very slow to load generally. Other pages using the same template but with jpeg or png images are much faster to load.

I get the following error in the JS console:

148730039_Capturedecran2021-03-08a13_07_19.thumb.png.9a903a5a85b1c9444fa44b0e618768d0.png

I develop locally using MAMP on macOS and I'm using Firefox. I'm using the last ProcessWire version (3.0.165).
I also tested in Chrome and got the same error.

Link to comment
Share on other sites

Hi,

sorry if it sounds like a silly answer 🙂 but, of course, i guess you have allowed svg format for your image field
if so, have you tried using the svg sanitizer module

https://processwire.com/modules/file-validator-svg-sanitizer/

and of course have you checked your svg source code, i use svg a lot and, when using them for a web page, i often have to simplify the xml code, getting rid of a lot of non useful code...

just in case 🙂

have a nice day

Link to comment
Share on other sites

Hi,

Thank you for your answer.

Yes I did allow for svg in the image field. Other svg files uploads fine, only slightly heavier one seems to pose problem.
The svg has been exported with Adobe Illustrator which does indeed produce bloated svg. I used an online compressor on the problematic file (https://vecta.io/nano) and it did upload after that. I'll look into the plugin you linked, thanks !

Also, the general slowness of the admin page seems to be gone when I put the website online, so it may have more to do with my local server settings or something.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...