(cp cdd4d3d2b) Only count PDF pages for PDF files

Fixes #2239
This commit is contained in:
plegall 2024-10-25 10:25:47 +02:00
parent fe18b49a85
commit fdefcffe0e

View file

@ -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');
?>
?>