Closed ryanholden8 closed 8 years ago
Hi Ryan, I'm at my day job. So I'll look at this later in the day.
I'm wondering if this should be handled at the SVGghLoader level too. I support runtime installation of a loader, but I hadn't thought to do it with a stream.
So, this will work with an XCAsset, as well as a subpath? I guess it won't need to modify the loaders.
Just added XCAsset support, unfortunately GzipInputStream
does not support NSData
so I pulled in NSData+IDZGunzip
to handle that. GzipInputStream
gets better performance though, so I left it.
Hi Ryan, I fixed some compile warning and merged your pull request. Thanks for the contribution. I'm sure a lot of people would like to use SVGz.
Thank you, Glenn!
Hi Glenn,
I have a situation where many SVGs will be downloaded via a server and stored on the user's device in the order of several 10s of MB. Storing SVGZ files will save a lot of space for the user, for this situation. File to fully rendered performance difference is extremely negligible (within 1MS of each other on a iPhone 5) and performance can even be slightly faster in some situations because of the reduced File I/O.
See: https://www.w3.org/TR/SVG11/conform.html#ConformingSVGViewers (Bullet Point:
SVG implementations must correctly support gzip-encoded
)