Tune how to get the size of SVG images. Ref https://github.com/GNS3/gns3-gui/issues/2674.

* Default for missing height/width is "100%" as defined in the SVG specification
* Better error message, if viewBox attribute is missing
* Removal of "%" in percent more fault tolerant by using rstrip("%")

(cherry picked from commit e3757a8955)
This commit is contained in:
grossmj committed 2019-01-21 23:49:43 +07:00
1 parent ef38ccfefa
commit 5f932fee9f
3 files changed
+27 -13

No files matched your search

@@ -60,7 +60,7 @@ class SymbolHandler:
r"/symbols/{symbol_id:.+}/raw",
description="Write the symbol file",
status_codes={
200: "Symbol returned"
200: "Symbol written"
},
raw=True)
def upload(request, response):
@@ -78,6 +78,7 @@ class SymbolHandler:
f.write(chunk)
except (UnicodeEncodeError, OSError) as e:
raise aiohttp.web.HTTPConflict(text="Could not write symbol file '{}': {}".format(path, e))
# Reset the symbol list
controller.symbols.list()
response.set_status(204)