diff --git a/src/wp-includes/class-wp-image-editor-imagick.php b/src/wp-includes/class-wp-image-editor-imagick.php
index fb56eb1..c89706c 100644
|
a
|
b
|
class WP_Image_Editor_Imagick extends WP_Image_Editor { |
| 147 | 147 | try { |
| 148 | 148 | $this->image = new Imagick(); |
| 149 | 149 | $file_parts = pathinfo( $this->file ); |
| | 150 | $filename = $this->file; |
| 150 | 151 | |
| 151 | 152 | // By default, PDFs are rendered in a very low resolution. |
| 152 | 153 | // We want the thumbnail to be readable, so increase the rendering dpi. |
| 153 | 154 | if ( 'pdf' == strtolower( $file_parts['extension'] ) ) { |
| 154 | 155 | $this->image->setResolution( 128, 128 ); |
| | 156 | |
| | 157 | // Only load the first page. |
| | 158 | $filename .= '[0]'; |
| 155 | 159 | } |
| 156 | 160 | |
| 157 | 161 | // Reading image after Imagick instantiation because `setResolution` |
| 158 | 162 | // only applies correctly before the image is read. |
| 159 | | $this->image->readImage( $this->file ); |
| | 163 | $this->image->readImage( $filename ); |
| 160 | 164 | |
| 161 | 165 | if ( ! $this->image->valid() ) |
| 162 | 166 | return new WP_Error( 'invalid_image', __('File is not an image.'), $this->file); |