yourhead / s3

public info about s3
8 stars 7 forks source link

Allow svg as stack icon instead of png #771

Closed jrondorf closed 6 years ago

jrondorf commented 6 years ago

Instead of the various needed png files, allow the use of one svg icon file, which will be used for display in the stacks library UI.

yourhead commented 6 years ago

this is would prohibitively costly in terms of performance because SVG needs to be rasterized as it's not a native format on macOS.

until macOS supports SVG natively it's best to do this rendering step on your end first.

sorry.

jrondorf commented 6 years ago

https://github.com/SVGKit/SVGKit

😉

yourhead commented 6 years ago

i think you misunderstood.

drawing svg isn't hard for me it's pretty easy. and likely to become a built in part of other things stacks does.

but loading from disk and drawing the icons for thousands of stacks on-the-fly (you can't do beforehand because rendering thousands of retina 128px retina images would eat all your memory) is not easy. anything that slows down that process feels like a bug because the library loads slowly or scrolls in a choppy way.

in order to make that a smooth nice experience for users we developers have to make sure that we've done everything we can on our end to make that as smooth and efficient as possible. this means choosing the format for stack files themselves and for the stack icons in a way that requires very little processing during this part of the process. this is why we use plist format for stacks and why images should be PNG.

this means the data is loaded from the disk and goes straight to the graphics card. no translation required at all.

rendering an SVG means allocating memory (slow) and rendering each shape described in the file -- there are no limits to the number of shapes in an SVG file -- so this process could be fast -- or slow -- you just don't know.

really -- for a variety of reasons -- SVG is a poor format for that task. it would surely be nice for us developers -- but would be a considerably poorer experience for users.

users would not be able to tell the difference between a SVG that stacks renders and an SVG that you render beforehand -- except that the SVG that stacks renders would be slower. that seems like a bum deal for users to me. no thanks. 😃