Closed Maxador closed 3 years ago
This sounds like new feature request.
Any better idea instead of this sucking length == 0 means keep length and use aspect ratio
? This sounds not a good design.
If we have no other good solution to let user provide this context (I want to keep length limit, width based on calculation), maybe this is the only way.
And if you change this, we'd better update the code and comments in both https://github.com/SDWebImage/SDWebImagePDFCoder and https://github.com/SDWebImage/SDWebImage.
I'll decide to merge this and update code comments as well. Then I need to sync this PR into SDWebImage Core and SDWebImagePDFCoder (Another vector format), which have the same use case.
@Maxador I extend the both preserve aspect ratio
and non-preserve aspect ratio
cases for 0 length. See #29
Very nice! Thank you!
For adding to your suggestion of not hijacking the Size context for that, we could add a new context option. Something like LengthConstraint
that could take a length type (enum for width or height) and a length value (CGFloat
).
For SVG bitmap image (such as watchOS), new version available in 1.6.0
If you want to keep aspect ratio, and does not know about What's the size of this SVG URL ?
this inforamtion. You can provide width or height to 0, which means ignore the limit.
See more complicated rules in README-Render SVG as bitmap image
Fix: https://github.com/SDWebImage/SDWebImageSVGCoder/issues/27
All the svgs are constrained to 34pt high