$ref, 'size' => $size, 'k' => $k, 'ext' => $ext, 'page' => $page, 'alt' => $alternative, 'usage' => $usage, 'usagecomment' => $usagecomment, ]; $resource_data = get_resource_data($ref); // Check whether original resource file extension matches $original_ext = $resource_data['file_extension'] ?? ''; if(!in_array(strtoupper($original_ext),$format_chooser_input_formats)) {return false;} $profile = getval('profile' , null); if (!empty($profile)) { $url_qs['profile'] = $profile; } else { $path = get_resource_path($ref, true, $size, false, $ext, -1, $page, $size=="scr" && checkperm("w") && $alternative == -1, '', $alternative); // We can use the existing previews unless we need to preserve the colour profiles, // these are likely to have been removed from scr size and below. // Alternative files not being converted can also use the existing file if ( file_exists($path) && ( !$imagemagick_preserve_profiles || in_array($size, array("hpr", "lpr", "")) || $alternative !== -1 ) ) { return false; } } return generateURL($baseurl_short . 'plugins/format_chooser/pages/convert.php', $url_qs); } // Following moved from collection_download to work for offline jobs function HookFormat_chooserAllReplaceuseoriginal() { global $format_chooser_output_formats, $format_chooser_profiles, $lang, $use_zip_extension, $collection_download_tar, $collection_download_tar_option; $disabled = ''; $submitted = getval('submitted', null); if (!empty($submitted) || $collection_download_tar_option) { $disabled = ' disabled="disabled "'; } $context = getval("ajax", '') !== "" ? "Modal" : "CentralSpace"; # Replace the existing ajax_download() with our own that disables our widgets, too if ($use_zip_extension) { ?>