Fatal error: Uncaught ImagickException: not authorized

QuestionsCategory: PDF Light ViewerFatal error: Uncaught ImagickException: not authorized
Tobias Persson asked 6 years ago
Hi,
 
When we try to import a pdf we got this error:
 
Fatal error: Uncaught ImagickException: not authorized `/web/se/shop.froviskor.se/wp-content/uploads/FroviSkor_katalog_VT2019_web.pdf’ @ error/constitute.c/ReadImage/412 in /web/se/shop.froviskor.se/wp-content/plugins/pdf-light-viewer/src/controllers/PdfController.php:824 Stack trace: #0 /web/se/shop.froviskor.se/wp-content/plugins/pdf-light-viewer/src/controllers/PdfController.php(824): Imagick->readimage(‘/web/se/shop.fr…’) #1 /web/se/shop.froviskor.se/wp-content/plugins/pdf-light-viewer/src/controllers/PdfController.php(712): PdfLightViewer_PdfController::getPDFPagesNumber(‘/web/se/shop.fr…’) #2 /web/se/shop.froviskor.se/wp-includes/class-wp-hook.php(288): PdfLightViewer_PdfController::save_post(12629, Object(WP_Post)) #3 /web/se/shop.froviskor.se/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array) #4 /web/se/shop.froviskor.se/wp-includes/plugin.php(465): WP_Hook->do_action(Array) #5 /web/se/shop.froviskor.se/wp-includes/post.php(3940): do_action(‘save_post_pdf_l…’, 12629, Object(WP_Post), true) in /web/se/shop.froviskor.se/wp-content/plugins/pdf-light-viewer/src/controllers/PdfController.php on line 824
 
We have version 1.4.4 and pro addon 0.3.0. We have Ghostscript 9.26 installed, php 7.2, latest version of WP.

  • os -> Linux apache23 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64
  • php -> 7.2.15-0ubuntu0.18.04.1
  • mysql -> 5.7.25-0ubuntu0.16.04.2
  • wordpress -> 5.1

 
What can it be?

1 Answers
support answered 6 years ago
Hello Tobias,
I presume you’ve uploaded a file via wordpress uploader and didn’t change file’s permissions afterwards.
In this case the issue could be in ImageMagick policy – https://stackoverflow.com/questions/37599727/php-imagickexception-not-authorized
Is this the first file you’re importing or you could successfully import PDFs before?