From ae7c1901f54b0282ed33390a8ce5c807fe08c1d6 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 12 Jul 2019 10:24:43 +0200 Subject: [PATCH] Use new method. --- coders/pdf.c | 53 +--------------------------------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/coders/pdf.c b/coders/pdf.c index 049f6e1d9..d881197f5 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -180,57 +180,6 @@ static MagickBooleanType IsPDF(const unsigned char *magick,const size_t offset) % */ -static void ReadPDFXMPProfile(PDFInfo *pdf_info,ByteBuffer *buffer) -{ -#define BeginXMPPacket "?xpacket begin=" -#define EndXMPPacket "profile != (StringInfo *) NULL) - return; - if (CompareByteBuffer(BeginXMPPacket,buffer,strlen(BeginXMPPacket)) == MagickFalse) - return; - length=8192; - pdf_info->profile=AcquireStringInfo(length); - found_end=MagickFalse; - p=(char *) GetStringInfoDatum(pdf_info->profile); - *p++='<'; - count=1; - for (c=ReadByteBuffer(buffer); c != EOF; c=ReadByteBuffer(buffer)) - { - if (count == (ssize_t) length) - { - length<<=1; - SetStringInfoLength(pdf_info->profile,length); - p=(char *) GetStringInfoDatum(pdf_info->profile)+count; - } - count++; - *p++=(char) c; - if (found_end == MagickFalse) - found_end=CompareByteBuffer(EndXMPPacket,buffer,strlen(EndXMPPacket)); - else - { - if (c == (int) '>') - break; - } - } - SetStringInfoLength(pdf_info->profile,(size_t) count); -} - static void ReadPDFInfo(const ImageInfo *image_info,Image *image, PDFInfo *pdf_info,ExceptionInfo *exception) { @@ -299,7 +248,7 @@ static void ReadPDFInfo(const ImageInfo *image_info,Image *image, } case '<': { - ReadPDFXMPProfile(pdf_info,&buffer); + ReadGhostScriptXMPProfile(&buffer,&pdf_info->profile); continue; } case '/': -- 2.40.0