I'm trying to get ImageMagick to count the amount of pages in a PDF file for me. The function is as follows:\[code\]<?phpfunction countPdfPages($filepath){ $magick = "identify -format %n ".$filepath; exec($magick, $debug, $result); return $result;}?>\[/code\]However, that function always returns \[code\]0\[/code\]. I have verified that ImageMagick is running properly, so that shouldn't be a problem. Am I not using \[code\]exec()\[/code\] properly? Should I retrieve the output in another way? I've also tried using \[code\]$debug\[/code\], but that didn't give me any output, oddly.I bet I'm doing something stupid here, but I just don't see it. Can anyone give me a push in the right direction? Thanks!