wp-includes/class-wp-image-editor-imagick.php:1306Load the image produced by Ghostscript.
true|WP_Error protected function pdf_load_source() { $filename = $this->pdf_setup(); if ( is_wp_error( $filename ) ) { return $filename; } foreach ( array( 'true', 'false' ) as $use_cropbox ) { try { /** * When generating thumbnails from cropped PDF pages, Imagemagick uses the uncropped * area (resulting in unnecessary whitespace) unless the following option is set. * * However, it sometimes fails, so if that happens, run it without the option. * * @ticket 48853 */ $this->image->setOption( 'pdf:use-cropbox', $use_cropbox ); /* * Reading image after Imagick instantiation because `setResolution` * only applies correctly before the image is read. */ if ( is_string( $this->stream_file_data ) ) { $this->image->setFilename( 'PDF:unknown.pdf[0]' ); $this->image->readImageBlob( $this->stream_file_data, $this->image_given_name ); } else { $this->image->readImage( $filename ); } return true; } catch ( Exception $e ) { continue; } } return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file ); }Introduced in 5.6.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-image-editor-imagick.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.