Giter VIP home page Giter VIP logo

sdwebimagesvgcoder's Introduction

SDWebImageSVGCoder

CI Status Version License Platform Carthage compatible

Background

Currently SDWebImage org provide 3 kinds of SVG Coder Plugin support, here is comparison:

Plugin Name Vector Image Bitmap Image Platform Compatibility Dependency
SVGNativeCoder NO YES iOS 9+ Best and W3C standard adobe/svg-native-viewer
SVGCoder YES YES iOS 13+ OK but buggy on some SVG Apple CoreSVG(Private)
SVGKitPlugin YES NO iOS 9+ Worst, no longer maintain SVGKit/SVGKit

What's for

SDWebImageSVGCoder is a SVG coder plugin for SDWebImage framework, which provide the image loading support for SVG.

The SVG rendering is done using Apple's framework CoreSVG.framework (introduced in iOS 13/macOS 10.15).

Note for SVGKit user

Previously before 1.0.0 version, this SVG Coder is powered by third party library SVGKit. Which support iOS 8+(macOS 10.10+) as well.

However, due to the lack support of that third party library, which contains massive issues without community's help, no clarity of version release, makes a pain for us to maintain. So, We decide to deprecate SVGKit support and move it into another repo: SDWebImageSVGKitPlugin.

User who use SVGKit or have to support iOS 8+(macOS 10.10+) can still use that SDWebImageSVGKitPlugin instead. You can also mix these two SVG coders at the same time. But since Apple already provide a built-in framework support, we prefer to use that instead, which can reduce complicated dependency, code size, and get polished from Apple's system upgrade.

Note for CoreSVG framework

So far (Xcode 11.4 && iOS 13.4), the CoreSVG.framework is still in private framework. I've already send the feedback radar to ask for the public for this framework. If you want, please help us to fire radars and request to Apple as well: https://feedbackassistant.apple.com/

The CoreSVG.framework API is stable and match the same concept as CoreGraphics's PDF API, so it's no reason to keep private. And we've already submitted Apps which use the CoreSVG to render the vector images on App Store.

All the SPI access here we use the runtime access and early check, even if future OS upgrade break the function, this framework will not crash your App and just load failed. I'll keep update to the latest changes for each firmware update.

If you still worry about the SPI usage, you can use SDWebImageSVGKitPlugin. But we may not response to any parser or rendering issue related to SVGKit, because it's already no longer maintained.

There is also another solution: SVG-Native, a new W3C standard from Adobe, which is a subset of SVG/1.1. Both Apple/Google/Microsoft already join the agreement for this standard, you can try to write your own coder using code from SVG-native-viewer and adopt SVG-native for vector images.

Warning: Some user report that Apple's CoreSVG has compatible issue for some SVGs (like using non-system Font, gradient), from v1.7.0 we protect some cases, but other exceptions are un-catchable. For these crashes, either use Render SVG as bitmap image (see below) or edit your SVG source file to make Apple's CoeSVG compatible.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

You can modify the code or use some other SVG files to check the compatibility.

Requirements

  • iOS 13+
  • tvOS 13+
  • macOS 10.15+
  • watchOS 6+

Installation

CocoaPods

SDWebImageSVGCoder is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SDWebImageSVGCoder'

Carthage

SDWebImageSVGCoder is available through Carthage.

github "SDWebImage/SDWebImageSVGCoder"

Swift Package Manager

SDWebImageSVGCoder is available through Swift Package Manager.

let package = Package(
    dependencies: [
        .package(url: "https://github.com/SDWebImage/SDWebImageSVGCoder.git", from: "1.4.0")
    ]
)

Usage

Render SVG as vector image

To use SVG coder, you should firstly add the SDImageSVGCoder to the coders manager. Then you can call the View Category method to start load SVG images. See Wiki - Coder Usage here for these steps.

Note SVG is a vector image format, and UIImageView/NSImageView support rendering vector image as well. Which means you can change the size without losing any details.

  • Objective-C
// register coder, on AppDelegate
SDImageSVGCoder *SVGCoder = [SDImageSVGCoder sharedCoder];
[[SDImageCodersManager sharedManager] addCoder:SVGCoder];
// load SVG url
UIImageView *imageView;
[imageView sd_setImageWithURL:url]
// Changing size
CGRect rect = imageView.frame;
rect.size.width = 200;
rect.size.height = 200;
imageView.frame = rect;
  • Swift
// register coder, on AppDelegate
let SVGCoder = SDImageSVGCoder.shared
SDImageCodersManager.shared.addCoder(SVGCoder)
// load SVG url
let imageView: UIImageView
imageView.sd_setImage(with: url)
// Changing size
var rect = imageView.frame
rect.size.width = 200
rect.size.height = 200
imageView.frame = rect

Note since UIImageView/NSImageView support this vector rendering, it means this coder plugin can be compatible for SwiftUI. Check SDWebImageSwiftUI for usage.

Note: for watchOS, which does not support UIKit, so you can not use vector image format. (including both SVG and PDF)

Render SVG as bitmap image

In most cases, vector SVG is preferred. But however, sometimes you may want the bitmap form of SVG, used for image processing or watchOS.

By default it use the SVG viewBox size. You can also specify a desired size during image loading using .imageThumbnailPixelSize context option. And you can specify whether or not to keep aspect ratio during scale using .imagePreserveAspectRatio context option.

Note: When using imageThumbnailPixelSize, pass 0 for width or height will remove the limit of this length. For example, given a SVG image which original size is (40,50):

preserve aspect ratio width height effect
true 50 50 (40,50)
true 0 100 (80,100)
true 20 0 (20,25)
true 0 0 (40,50)
false 50 50 (50,50)
false 0 100 (40,100)
false 20 0 (20,50)
false 0 0 (40,50)

Note: Once you pass the imageThumbnailPixelSize, we will always generate the bitmap representation. If you do want the vector format, do not pass them, let UIImageView to dynamically stretch the SVG.

  • Objective-C
UIImageView *imageView;
CGSize bitmapSize = CGSizeMake(500, 500);
[imageView sd_setImageWithURL:url placeholderImage:nil options:0 context:@{SDWebImageContextThumbnailPixelSize: @(bitmapSize)];
  • Swift
let imageView: UIImageView
let bitmapSize = CGSize(width: 500, height: 500)
imageView.sd_setImage(with: url, placeholderImage: nil, options: [], context: [.imageThumbnailPixelSize : bitmapSize])

Export SVG data

SDWebImageSVGCoder provide an easy way to export the SVG image generated by this coder plugin, to the original SVG data.

Note: The bitmap form of SVG does not support SVG data export.

  • Objective-C
UIImage *svgImage; // UIImage with vector image, or NSImage contains `NSSVGImageRep`
if (svgImage.sd_isVector) { // This API available in SDWebImage 5.6.0
    NSData *svgData = [svgImage sd_imageDataAsFormat:SDImageFormatSVG];
}
  • Swift
let svgImage: UIImage // UIImage with vector image, or NSImage contains `NSSVGImageRep`
if svgImage.sd_isVector { // This API available in SDWebImage 5.6.0
    let svgData = svgImage.sd_imageData(as: .SVG)
}

Compatibility for CoreSVG framework

The CSS opacity can not been applied when fill color exists

  • Example
<path d="M399.8,68.2c77.3,3.1,160.6,32.1" opacity="0.15" fill="rgb(29,36,60)" />
  • Behavior

App Crash.

  • Workaround: Use CSS rgba to set the opacity instead.
<path d="M399.8,68.2c77.3,3.1,160.6,32.1" fill="rgba(29,36,60,0.15)" />

Backward Deployment

This framework supports backward deployment on iOS 12-/macOS 10.14-. And you can combine both SDWebImageSVGCoder for higher firmware version, use SDWebImageSVGKitPlugin for lower firmware version.

For CocoaPods user, you can skip the platform version validation in Podfile with:

platform :ios, '13.0' # This does not effect your App Target's deployment target version, just a hint for CocoaPods

Pay attention, you should always use the runtime version check to ensure those symbols are available, you should mark all the classes use public API with API_AVAILABLE annotation as well. See below:

if (@available(iOS 13, *)) {
    [SDImageCodersManager.sharedCoder addCoder:SDImageSVGCoder.sharedCoder];
} else {
    [SDImageCodersManager.sharedCoder addCoder:SDImageSVGKCoder.sharedCoder];
}

Screenshot

These SVG images are from wikimedia, you can try the demo with your own SVG image as well.

Author

DreamPiggy

License

SDWebImageSVGCoder is available under the MIT license. See the LICENSE file for more info.

sdwebimagesvgcoder's People

Contributors

ap-for-work avatar dreampiggy avatar marcprux avatar maxador avatar sems avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdwebimagesvgcoder's Issues

Unable to render SVG image on watchOS

Hello! I'm having an issue rendering SVG images on watchOS and I'm wondering if you can help me out.

I'm using SDWebImageSVGCoder along with SDWebImageSwiftUI to try and show SVG images in a watchOS app. I've created an example project that uses Cocoapods to pull in version 1.5.0 of SDWebImageSVGCoder. In that app, I'm doing the following:

struct ContentView: View {
	var body: some View {
		VStack {
			WebImage(url: URL(string: "https://upload.wikimedia.org/wikipedia/commons/8/81/Wikimedia-logo.svg"))
				.resizable()
				.frame(width: 50, height: 50)
				.background(Color.red)
			WebImage(url: URL(string: "https://commons.wikimedia.org/static/images/project-logos/commonswiki.png"))
				.resizable()
				.frame(width: 50, height: 50)
				.background(Color.green)
		}
    }
}

The top image is an SVG and the bottom in a PNG. This is what the app looks like:

Screen Shot 2020-08-10 at 6 40 01 PM

As you can see, the SVG here didn't load. What's interesting is that if I set a breakpoint in SDImageSVGCoder.m at line 124, which is the very end of the decodedImageWithData:options: function, I can see in the debugger that an image is created:

(lldb) po image
<UIImage:0x803349f0 anonymous {1024, 1024}>

The interesting thing is that it is the proper size of the SVG at the URL that I'm passing in, but doing a quicklook of the image in the debugger shows that it's a transparent image:

Screen Shot 2020-08-10 at 6 43 46 PM

Am I doing something incorrect here? Or is there a bug with rendering these SVG images on watchOS? Thanks so much for the help!

Wrong rendering of minified SVG files in iOS15 and below

I'm facing an issue rendering some SVG images which are minified in iOS15 and below, that is, some spaces are removed inside the path to reduce svg size. In those cases (minified ones) the image is rendered missing some paths. It can be checked using these two images:

Minified Normal
minifiedVersion normalVersion

As you can see the "+" is not rendered in the minified version:

NormalMinified

As far as I've could investigate the problem occurs in the arc paths (the ones starting with a) in which this format:

a.689.689 0 0 1 0 1.377

is replaced by this one:

a.689.689 0 010 1.377

Both images are shown correctly in any SVG viewer. Anyone facing this issue too?

Thanks!

Not using height, width from inside the SVG

When I load in an image into WebImage in SwiftUI using SDWebImageSwiftUI, it's supposed to use the default size of the image as specified by the file unless I change it using the resizable and frame modifiers. However, I'm loading an SVG image in that has a height of 55, but when I display it, the image displayed is not 55 and is instead being blown up to a much larger size.

This should work:
WebImage(url: URL(string: "https://qonsent.dev3.granitedata.io/assetsPublic/logo-allstate.svg"))

But instead I'm having to use this code which isn't good enough because some images are not 55 in height so this doesn't work for all of the images we have.
WebImage(url: URL(string: "https://qonsent.dev3.granitedata.io/assetsPublic/logo-allstate.svg"))
.resizable()
.scaledToFit()
.frame( maxHeight: 55, alignment: .center)

Please add in support to correctly size an image based on the height and width inside of the SVG file.

Redefinition of 'SDImageFormatSVG'

SDImageSVGCoder.h
static const SDImageFormat SDImageFormatSVG = 12;

NSData_ImageContentType.h
static const SDImageFormat SDImageFormatSVG = 8;

The svg image is not fully displayed

I want to display this svg, but it's not fully displayed.
This svg contains two flag pngs which are not fully displayed.
Here is my code

func sdwebimage(){
        // register coder, on AppDelegate
        let SVGCoder = SDImageSVGCoder.shared
        SDImageCodersManager.shared.addCoder(SVGCoder)
        // load SVG url
        let imageView: UIImageView = UIImageView(frame:CGRect(x: 0, y: 100, width: 318, height: 318))
        let urlStr = "https://izfetdisq5mm63fsdwunhrsidlqbx5ul6mei74o27oqzrdhhhuza.arweave.net/RkpJjRKHWM9ssh2o08ZIGuAb9ovzCI_x2vuhmIznPTI"
        let url = URL(string: urlStr)
        let bitmapSize = CGSize(width: 318, height: 318)
        imageView.sd_setImage(with: url, placeholderImage: nil, options: [], context: [.imageThumbnailPixelSize : bitmapSize])
        //        imageView.sd_setImage(with: url, placeholderImage: nil, options: [], context: [ : ])
        self.view.addSubview(imageView)
}

Screenshot 2022-12-01 at 15 51 58

SVG Image change to black color

Hi! I'm having a problem when I load an svg image from a URL.

The image color in the browser looks fine but after downloading it in the app implementation, the image changes to black.

I'm using

  • SDWebImageSVGNativeCoder

Tested in two simulators:

  • iPhone 14 pro iOS 16.2
  • iPhone 8 iOS 14.3

I've tested in my own app and in your example app (https://github.com/SDWebImage/SDWebImageSVGNativeCoder) and the result is the same. I've got the black image.

Here are some URL examples:
https://test.yoyumm.4livedemo.com/image/cuisines/4/400/400
https://test.yoyumm.4livedemo.com/image/cuisines/6/400/400

Hopefully, you can help me.

Best wishes!

Decoded SVG is not a vector on macOS

After decoding an SVG to an NSImage on macOS 14.4.1, the sd_isVector property returns false:

func testDecodeSVG() throws {
    let url = Bundle(for: AppTests.self).url(forResource: "flag", withExtension: "svg")!
    let svgData = try! Data(contentsOf: url)
        
    let image = SDImageSVGCoder.shared.decodedImage(with: svgData, options: [:])!
    XCTAssertTrue(image.sd_isVector) // false
    print(image.representations)
}

However, printing the NSImage's representations reveals it does contain an NSSVGImageRep:

[_NSSVGImageRep 0x600002e7caf0 Size={1235, 650} ColorSpace=Generic RGB colorspace BPS=0 Pixels=0x0 Alpha=NO AppearanceName=(null)]

Could not display SVG image

I want to display SVG image from URL, I am using SDWebImageSVGCoder but it could not display my image, but when I change the image with another one it is displayed correctly.

let svgURL = URL(string: "https://www.sharjahairport.ae/social/svg/ABY.svg")!
cell.imgView.sd_setImage(with: svgURL) { (image, _, _, _) in
if let img = image {
cell.imgView.image = img
}
}

If 'x' inside 'text' represents multiple values, it will result in a rendering error.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill-rule="evenodd" height="48" preserveAspectRatio="none" stroke-linecap="round" viewBox="0 0 2240 480" width="224">
<style type="text/css">
.brush0 { fill: rgb(255,255,255); }
.pen0 { stroke: rgb(0,0,0); stroke-width: 1; stroke-linejoin: round; }
.font0 { font-size: 303px; font-family: "Times New Roman", serif; }
.font1 { font-style: italic; font-size: 303px; font-family: "Times New Roman", serif; }
.font2 { font-size: 274px; font-family: Symbol, serif; }
.font3 { font-weight: bold; font-size: 16px; font-family: System, sans-serif; }
</style>
<g>
<text class="font0" fill="rgb(0,0,0)" stroke="none" style="dominant-baseline: alphabetic;" x="154 264 836 1473 1925" xml:lang="en" xml:space="preserve" y="320">(3)13</text>
<text class="font1" fill="rgb(0,0,0)" stroke="none" style="dominant-baseline: alphabetic;" x="49 731 2077" xml:lang="en" xml:space="preserve" y="320">iii</text>
<text class="font2" fill="rgb(0,0,0)" stroke="none" style="dominant-baseline: alphabetic;" x="484 1026 1290 1678" xml:space="preserve" y="320">+=-+</text>
</g>
</svg>
截屏2024-01-18 16 41 26 截屏2024-01-18 16 43 04

In the aforementioned code, the 'x' inside 'text' represents multiple values, it seems that the current types of 'Coder' are not compatible.

SwiftUI SVG -> WebImage Inconsistencies

This coder was super easy to add which was awesome right off the bat, but I'm seeing some issues with most SVG's I try drawing.

Would love some help if I'm doing something wrong. Examples below.

SwiftUI code used:

WebImage(url: URL(string: "https://storage.opensea.io/files/30cdec8b3f25da72e82bba1c36c23fa6.svg")!, context: [.imageThumbnailPixelSize: CGSize.zero])
    .resizable()
    .scaledToFit()
    .border(Color.gray)

Example 1:

SVG url:
https://storage.opensea.io/files/30cdec8b3f25da72e82bba1c36c23fa6.svg

Output:
CleanShot 2022-02-09 at 08 11 55@2x

Issue:
This SVG is just a colored square, so ideally it should fill the entire frame of the WebImage. Instead it's only occupying a small portion.

Example 2:

SVG url:
https://storage.opensea.io/files/0a551bef6cba9c8af017420aafe7657a.svg

Output:
CleanShot 2022-02-09 at 08 16 53@2x

Issue:
The text inside the SVG is not centered.

Can provide more examples if needed.
Also happy to create a pull request to the coder if I could get a little guidance on the nature of the issues(s)

Thank you!

Not refreshed Image

Hello Team,

Thanks a lot for make a good library for SVG images.

I want to show both .SVG and any-other type of image. I have showed images successfully but the problem is when i update the image from server but am showing previous image. Run time changed images not working. Please suggest me how i can show new images at run time. Thanks.

Suggestion: Drop SVGKit support and use SVG-Native standard for mobile system

SVGKit repo seems no longer activelly maintained. And the SVG features support is still lack of support for long time. And there are many many of bugs in implementation.

Across all the open-source world, there are no any SVG library that implements the standard on iOS system, including SwiftSVG, Macaw, etc. I've already try all of them.

Recentlly, there is a new W3C standard called SVG-Native. It's aim to provide a SVG vector format which based on SVG 1.1, without some features which heavily required Web environment, like CSS, Script, x-linking.

I think this is the future of our library to support SVG, a vector format. Since our users always use the Native rendering engine, we're not a WebKit port to render some vector format (So why not using WKWebView?).

If you think this is the correct way to use vector format on mobile system, I'd like to implements with the support library once the SVG-Native 1.0 standard is released.

WidgetKit SVG Image not working

I'm attempting to get SVG's in SwiftUII for WidgetKit but the images won't load in the widget. It works fine in a SwiftUI app. Getting the yellow and red circle with a line through it. Is this at all possible in WidgetKit.

import SDWebImageSVGCoder
import SDWebImageSwiftUI

struct SVGImage: UIViewRepresentable {
    var url: URL
    
    func makeUIView(context: Context) -> UIImageView {
        let SVGCoder = SDImageSVGCoder.shared
        SDImageCodersManager.shared.addCoder(SVGCoder)
        let imageView = UIImageView(image: UIImage(systemName: "questionmark"))
        imageView.sd_setImage(with: url, placeholderImage: UIImage(named: "questionmark"))
        return imageView
    }
    
    func updateUIView(_ uiView: UIImageView, context: Context) {
    }
}

Could not display SVG image correctly in SwiftUI

I want to display SVG image from URL in SwiftUI, I am using SDWebImageSVGCoder but it could not display my image.

AnimatedImage(url: URL(string: "https://d4rgq65mqvxhk.cloudfront.net/public/gift_icons/officialGift%2378548ed1-9c95-4634-b355-ca8c2a53da4f.svg"))

Expected result

Actual result

Small SVG renders blurry on watchOS

If I try to render an SVG with a bigger size than the SVG file is setting, the image will render blurry.
I tried to use the solution proposed in #24 but without success.
I had it kinda working by setting values to my CGSize like this [.imageThumbnailPixelSize : CGSize(width: 34, height: 34)] but unfortunately not all my images are square and I don't want to constraint the width.

SwiftUI Rendering code

WebImage(url: imageURL), context: [.imageThumbnailPixelSize : CGSize.zero])
            .renderingMode(.template)
            .resizable()
            .placeholder(Image(systemName: "photo"))
            .scaledToFit()
            .frame(height: 34)
            .padding(.bottom, 6)
CGSize.zero CGSize(width: 34, height: 34)
Simulator Screen Shot - Apple Watch Series 6 - 44mm - 2020-12-11 at 09 28 24 Simulator Screen Shot - Apple Watch Series 6 - 44mm - 2020-12-11 at 09 30 20

Is there a way to render the bitmap to a certain height without requesting a width while keeping the aspect ratio of the image?

Getting Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT) on loading svg

Am using

SDWebImage
SDWebImageSVGCoder

To Load the following svg

https://gcf-media.s3.ap-south-1.amazonaws.com/subject-tags/practice-cards/Green_color_with_pattern.svg

like this sd_setImage(with: urlString, placeholderImage: placeholderImage)

Getting error as Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)

image

I tried using sd_internalSetImage and passing an SDSetImageBlock and tried getting the image and set it by myself but still the same issue occurs.

Any thoughts?

Crash on [SVGKParser addParserExtension:] + 408

I am using this on uitableview.
Notice a huge crash logs from Fabric. Can anyone help?

Crashed: com.hackemist.SDWebImageDownloaderOperationCoderQueue
0  libobjc.A.dylib                0x1e2f93bf0 objc_retain + 16
1  SVGKit                         0x104e627ec -[SVGKParser addParserExtension:] + 408
2  SVGKit                         0x104e625f0 -[SVGKParser addDefaultSVGParserExtensions] + 284
3  SVGKit                         0x104e62354 +[SVGKParser newParserWithDefaultSVGKParserExtensions:] + 100
4  SVGKit                         0x104e62380 +[SVGKParser parseSourceUsingDefaultSVGKParser:] + 24
5  SVGKit                         0x104e5f6f0 -[SVGKImage initWithSource:] + 64
6  SVGKit                         0x104e5f8b4 -[SVGKImage initWithData:] + 184
7  SDWebImageSVGCoder             0x104e2b880 -[SDImageSVGCoder decodedImageWithData:options:] + 100
8  SDWebImage                     0x104d8755c -[SDImageCodersManager decodedImageWithData:options:] + 348
9  SDWebImage                     0x104d89f3c SDImageLoaderDecodeImageData + 828
10 SDWebImage                     0x104d940b4 __70-[SDWebImageDownloaderOperation URLSession:task:didCompleteWithError:]_block_invoke.198 + 216
11 libdispatch.dylib              0x1e37e0a38 _dispatch_call_block_and_release + 24
12 libdispatch.dylib              0x1e37e17d4 _dispatch_client_callout + 16
13 libdispatch.dylib              0x1e378a324 _dispatch_lane_serial_drain$VARIANT$mp + 592
14 libdispatch.dylib              0x1e378ae40 _dispatch_lane_invoke$VARIANT$mp + 428
15 libdispatch.dylib              0x1e37934ac _dispatch_workloop_worker_thread + 596
16 libsystem_pthread.dylib        0x1e39c2114 _pthread_wqthread + 304
17 libsystem_pthread.dylib        0x1e39c4cd4 start_wqthread + 4

critical error

in line:

for( NSString* parserNamespace in extension.supportedNamespaces )

Thread 12: EXC_BAD_ACCESS (code=1, address=0x7b56d99f0)

Redefinition of 'SDImageFormatSVG'

When I install these two libraries using CocoaPod 'SDWebImage' and 'SDWebImageSVGCoder'.

I got error says that 'static const SDImageFormat SDImageFormatSVG = 8' is redefined in

  1. NSData+ImageContentType.h in SDWebImage Module

  2. SDImageSVGCoder.h in SDWebImageSVGCoder plugin module

Screenshot 2020-03-24 at 12 22 55 AM

Screenshot 2020-03-24 at 12 22 41 AM

How can I resolve this issue?

Support for Privacy Manifest

As per new Privacy Manifest requirement, all 3rd party sdks need to include the privacy details in PrivacyInfo.xcprivacy file. How to include Privacy Manifest for SDWebImageSVGCoder?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.