Closed AndriiPetrovDev closed 1 year ago
Seems SVG use a font which native iOS platform does not embed.
Does this a Objective-C exception (or C++ exception) which can be handled by our user level code ?
If so, we can add a protect here. To make it Load SVG failed
but not crash your user app.
font-family="宋体"
It will be really nice.
Can we solve such problems for all possible alphabets?
Does this a Objective-C exception (or C++ exception) which can be handled by our user level code ?
Did you test this ?
There is another crash, EXC_BADACCESS on SDCGSVGDocumentWriteToData method. But it happens only at first load, subsequent load attempt won't crash. I also tried with SDWebImageSVGNativeCoder but this time it shows the file as pure black.
This is the svg file;
as text: general.txt
SDCGSVGDocumentWriteToData
is used to re-export UIImage to NSData. So why do you meanBut it happens only at first load, subsequent load attempt won't crash
?
I don't think these two is the same issue. SDWebImage itself should not re-encode SVG image to NSData if you don't specify this (using thumbnail or transformer)
Actually, the SVG export
feature is not really useful in general, because SVG is vector image format. For the re-export, you can just save the data (download from SVG URL) and re-read it
Is this logic bug ? Any demo can reproduce your But it happens only at first load, subsequent load attempt won't crash
?
For normal WebImage loading process, it should not trigger re-encode logic.
Try to open this image https://openseauserdata.com/files/b809fe0925eb3629bb1d3edb1fafcc88.svg SDWebImage crashes because "NSFont can't be nil"