From 070c3fbc5731c7e5d4c290b961e93890a6862d68 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 17 Mar 2017 14:38:11 -0400 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31530 --- ChangeLog | 4 ++-- coders/pdf.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0efb8d79f..7e0f049ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2017-03-14 7.0.5-3 Cristy * Support namespaces for the security policy. + * Support the -authenticate option for PDF (reference + Counting objects: 7, done.g/discourse-server/viewtopic.php?f=3&t=31530). 2017-03-11 7.0.5-2 Cristy * Release ImageMagick version 7.0.5-2, GIT revision 19696:da91a7c:20170311. @@ -9,8 +11,6 @@ https://github.com/ImageMagick/ImageMagick/issues/393). * Return proper minima / maxima (reference https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31377). - * Support the -authenticate option for PDF (reference - Counting objects: 7, done.g/discourse-server/viewtopic.php?f=3&t=31530). 2017-03-03 7.0.5-1 Cristy * Release ImageMagick version 7.0.5-1, GIT revision 19662:b7f455a:20170303. diff --git a/coders/pdf.c b/coders/pdf.c index dd3bc0c32..d4a932600 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -721,6 +721,16 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception) MagickPathExtent); if (trimbox != MagickFalse) (void) ConcatenateMagickString(options,"-dUseTrimBox ",MagickPathExtent); + option=GetImageOption(image_info,"authenticate"); + if (option != (char *) NULL) + { + char + passphrase[MagickPathExtent]; + + (void) FormatLocaleString(passphrase,MagickPathExtent, + "'-sPDFPassword=%s' ",option); + (void) ConcatenateMagickString(options,passphrase,MagickPathExtent); + } read_info=CloneImageInfo(image_info); *read_info->magick='\0'; if (read_info->number_scenes != 0) -- 2.40.0