|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-09-25 07:52 UTC] mkoppanen@php.net
-Status: Open
+Status: Feedback
[2013-09-25 07:52 UTC] mkoppanen@php.net
[2013-10-15 11:54 UTC] pecl-dev at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 05:00:01 2025 UTC |
Description: ------------ In some cases, PDF pages aren't properly detected when running getNumberImages in this example there should be 34 pages, but Imagick says there is only 1. I'm in doubt if getNumberImages should count PDF pages. if you run "identify delta.pdf" from the shell it lists all the pages with alot of info, on each new line. but the output of Imagick::identifyImage is the closest I can come to the identify command. A workaround hack would be to call exec("identify $x") but isn't the best solution. A solution would be to either improve one of the two functions, or create a new one, Imagick::getNumberPages I've added som examples on how output could be below Test script: --------------- Example PDF file (save as delta.pdf) http://www.roms4droid.com/manuals/PC%20Games/Manuals%20%28USA%29/D-F/Delta%20Force%204%20-%20Task%20Force%20Dagger%20-%20Mission%20Editor%20Manual.pdf <?php $f = "delta.pdf"; $pdf = new Imagick($f); var_dump($pdf->getNumberImages()); var_dump($pdf->identifyImage()); ?> Expected result: ---------------- int(34) array(9) { ["imageName"]=> string(10) "/delta.pdf" ["format"]=> string(30) "PDF (Portable Document Format)" ["geometry"]=> array(2) { ["width"]=> int(612) ["height"]=> int(792) } ["resolution"]=> array(2) { ["x"]=> float(72) ["y"]=> float(72) } ["units"]=> string(9) "Undefined" ["type"]=> string(14) "TrueColorAlpha" ["colorSpace"]=> string(4) "sRGB" ["compression"]=> string(9) "Undefined" ["fileSize"]=> string(7) "3.203MB" ["numberPages"]=> int(32) } Actual result: -------------- int(1) array(9) { ["imageName"]=> string(10) "/delta.pdf" ["format"]=> string(30) "PDF (Portable Document Format)" ["geometry"]=> array(2) { ["width"]=> int(612) ["height"]=> int(792) } ["resolution"]=> array(2) { ["x"]=> float(72) ["y"]=> float(72) } ["units"]=> string(9) "Undefined" ["type"]=> string(14) "TrueColorAlpha" ["colorSpace"]=> string(4) "sRGB" ["compression"]=> string(9) "Undefined" ["fileSize"]=> string(7) "3.203MB" }