From: Dirk Lemstra Date: Fri, 12 Jul 2019 08:24:43 +0000 (+0200) Subject: Use new method. X-Git-Tag: 7.0.8-54~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae7c1901f54b0282ed33390a8ce5c807fe08c1d6;p=imagemagick Use new method. --- 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 '/':