TPdfIccProfileLimits = record
MaxProfileBytes: Int64;
MaxTagCount: Integer;
class function Default: TPdfIccProfileLimits; static;
end;
TPdfIccProfileIssue = (ipiTooLarge, ipiHeaderTruncated, ipiSizeMismatch, ipiSignatureInvalid, ipiUnsupportedColorSpace, ipiTagCountExceeded, ipiTagTableTruncated, ipiTagDataOutOfBounds);
TPdfIccProfileIssues = set of TPdfIccProfileIssue;
TPdfIccProfileInfo = record
Issues: TPdfIccProfileIssues;
ByteSize: Int64;
DeclaredSize: Int64;
Version: string;
VersionBytes: AnsiString;
DeviceClass: string;
DataColorSpace: string;
DataColorSpaceSignature: AnsiString;
Pcs: string;
ComponentCount: Integer;
TagCount: Integer;
Md5: string;
Sha256: string;
ProfileId: string;
ProfileDescription: string;
function IsValid: Boolean;
end;
function InspectPdfIccProfile(const Data: TBytes): TPdfIccProfileInfo;
function InspectPdfIccProfile(const Data: TBytes;
const Limits: TPdfIccProfileLimits): TPdfIccProfileInfo;
function PdfIccProfileDescriptionMatches(const Data: TBytes;
const Expected: string): Boolean;
يتحقق InspectPdfIccProfile من الترويسة بطول 128 بايتًا، وحجم الملف المعلن، وتوقيع acsp، وعدد مكونات فضاء اللون، وعدد الوسوم المحدود، وامتداد جدول الوسوم، وكل مدى بيانات وسم قبل كشف البيانات الوصفية
تتضمن النتيجة توقيعات الإصدار وفضاء اللون الخام بعرض أربعة بايتات، وقيم العرض، وعدد المكونات والوسوم، ومعرِّف ملف التعريف، و MD5 للملف الكامل، و SHA-256، وفئة الجهاز، و PCS، وأول وصف ملف تعريف صالح
يتعرف الفاحص العام على توقيعات GRY و RGB و CMYK ومن 2CLR حتى FCLR؛ وقد تفرض المُصادقات الخاصة بكل صيغة سياسة ألوان عملية أضيق
يفحص PdfIccProfileDescriptionMatches قيمة desc للإصدار الثاني أو كل سجل locale محدود في profileDescriptionTag للإصدار الرابع من نوع mluc
| الحد | الافتراضي | الغرض |
|---|---|---|
MaxProfileBytes | 64 MiB | يوقف تحليل الملفات ذات التعريف الضخمة وتجزئتها |
MaxTagCount | 4096 | يحد عبور جدول الوسوم |
TPdfIccProfileInfo.IsValid بقيمة True فقط عندما تكون مجموعة المشكلات فارغة