diff --git a/picture.php b/picture.php index 38416c0a9..153f6276b 100644 --- a/picture.php +++ b/picture.php @@ -971,12 +971,14 @@ SELECT id, name, permalink } } -$template->assign( - array( - 'PDF_VIEWER_FILESIZE_THRESHOLD' => $conf['pdf_viewer_filesize_threshold']*1024, - 'PDF_NB_PAGES' => count_pdf_pages($picture['current']['path']) - ) -); +if (str_ends_with(strtolower($picture['current']['file']), "pdf" )) { + $template->assign( + array( + 'PDF_VIEWER_FILESIZE_THRESHOLD' => $conf['pdf_viewer_filesize_threshold']*1024, + 'PDF_NB_PAGES' => count_pdf_pages($picture['current']['path']) + ) + ); +} // maybe someone wants a special display (call it before page_header so that // they can add stylesheets) @@ -1044,4 +1046,4 @@ else //------------------------------------------------------------ log informations pwg_log($picture['current']['id'], 'picture'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); -?> \ No newline at end of file +?>