UploadHandler.php -> UploadHandler class -> create_scaled_image function
You have to override the image size getter, make a condition to detect or set a fixed size for pdf files and execute this only on non pdf files:
list($img_width, $img_height) = @getimagesize($file_path);
add a boolean i.e. $ispdf (set to false before the switch)
add a "case" for 'pdf' before the default like this:
case 'pdf'
$ispdf = true;
default:
$src_img = null;
change
if ($ispdf) {
exec('command', $output, $return_code);
if ($return_code === 0) { $success = true; }
}
return $success;
You can use $options['max_width'] or $options['max_height'] to pass size of thumbnail to imagemagick command OR $new_width and $new_height if you made size getter