Added the PDF/SVG image type define

This commit is contained in:
DreamPiggy 2020-01-30 13:31:57 +08:00
parent aa7ff6f060
commit cb84dbb273
2 changed files with 12 additions and 0 deletions

View File

@ -23,6 +23,8 @@ static const SDImageFormat SDImageFormatTIFF = 3;
static const SDImageFormat SDImageFormatWebP = 4;
static const SDImageFormat SDImageFormatHEIC = 5;
static const SDImageFormat SDImageFormatHEIF = 6;
static const SDImageFormat SDImageFormatPDF = 7;
static const SDImageFormat SDImageFormatSVG = 8;
/**
NSData category about the image content type and UTI.

View File

@ -93,6 +93,12 @@
case SDImageFormatHEIF:
UTType = kSDUTTypeHEIF;
break;
case SDImageFormatPDF:
UTType = kUTTypePDF;
break;
case SDImageFormatSVG:
UTType = kUTTypeScalableVectorGraphics;
break;
default:
// default is kUTTypePNG
UTType = kUTTypePNG;
@ -120,6 +126,10 @@
imageFormat = SDImageFormatHEIC;
} else if (CFStringCompare(uttype, kSDUTTypeHEIF, 0) == kCFCompareEqualTo) {
imageFormat = SDImageFormatHEIF;
} else if (CFStringCompare(uttype, kUTTypePDF, 0) == kCFCompareEqualTo) {
imageFormat = SDImageFormatPDF;
} else if (CFStringCompare(uttype, kUTTypeScalableVectorGraphics, 0) == kCFCompareEqualTo) {
imageFormat = SDImageFormatSVG;
} else {
imageFormat = SDImageFormatUndefined;
}