Closed imgbot[bot] closed 4 months ago
Not sure why it did not optimise SVGs, it usually does. I did so manually. Most of the SVGs had Inkscape metadata, blowing their size up to x10. It is totally insane that it stores all this crap, like its window and grid size and positions and all this stuff, which really only affects and reflects the view status of the SVG in the Inkscape software, inside the SVG, instead of an own local cache file. The absolute size, of course, it not huge, but SVGs are often used for small icons, with a few bytes path, so the Inkscape metadata blows this up to a multiple easily, causing unnecessary traffic and load ...
I mean, see this recording button, which consists of two cycles, should and now does look like this:
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><circle cx="20" cy="20" r="13" fill="none" stroke="#3498db" stroke-width="2"/><circle cx="20" cy="20" r="6" fill="#3498db"/></svg>
And this is the Inkscape version:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="40"
height="40"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="camera-action-buttons.svg"
inkscape:export-filename="../motioneye_inkspace/split/camera-action-button--snapshot.svg"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#aaaaaa"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.74509804"
inkscape:pageshadow="2"
inkscape:zoom="8"
inkscape:cx="579.29889"
inkscape:cy="13.896368"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:window-width="1920"
inkscape:window-height="1025"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:snap-bbox="true"
inkscape:bbox-nodes="true"
inkscape:bbox-paths="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="true"
inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
inkscape:snap-page="true"
inkscape:snap-intersection-paths="true"
showguides="false"
inkscape:guide-bbox="true"
inkscape:showpageshadow="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050">
<inkscape:grid
type="xygrid"
id="grid4156"
empspacing="20"
enabled="true"
visible="true"
snapvisiblegridlinesonly="false"
originx="-280"
originy="0"
spacingy="1"
spacingx="1"
units="px" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-280,-1012.3622)">
<circle
style="fill:none;stroke:#3498db;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="circle4233"
cx="300"
cy="1032.3623"
r="13" />
<circle
style="opacity:1;fill:#3498db;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path4235"
cx="300"
cy="1032.3622"
r="6" />
</g>
</svg>
Beep boop. Your images are optimized!
Your image file size has been reduced by 21% 🎉
Details
| File | Before | After | Percent reduction | |:--|:--|:--|:--| | /motioneye/static/img/main-loading-progress.gif | 6.38kb | 3.99kb | 37.43% | | /motioneye/static/img/camera-progress.gif | 49.62kb | 39.12kb | 21.16% | | /motioneye/static/img/small-progress.gif | 0.66kb | 0.62kb | 5.79% | | /motioneye/static/img/modal-progress.gif | 4.29kb | 4.14kb | 3.51% | | | | | | | **Total :** | **60.94kb** | **47.87kb** | **21.46%** |📝 docs | :octocat: repo | 🙋🏾 issues | 🏪 marketplace
~Imgbot - Part of Optimole family