Index: src/wp-includes/class-wp-image-editor-imagick.php
===================================================================
--- src/wp-includes/class-wp-image-editor-imagick.php	(revision 46818)
+++ src/wp-includes/class-wp-image-editor-imagick.php	(working copy)
@@ -154,6 +154,12 @@
 				return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file );
 			}
 
+			if ( 'pdf' === $file_extension ) {
+				// When generating thumbnails from cropped PDF pages, Imagemagick uses the uncropped
+				// area (resulting in unnecessary whitespace) unless the following option is set.
+				$this->image->setOption( 'pdf:use-cropbox', true );
+			}
+
 			// Select the first frame to handle animated images properly
 			if ( is_callable( array( $this->image, 'setIteratorIndex' ) ) ) {
 				$this->image->setIteratorIndex( 0 );
@@ -794,10 +800,6 @@
 			// We want the thumbnail to be readable, so increase the rendering DPI.
 			$this->image->setResolution( 128, 128 );
 
-			// When generating thumbnails from cropped PDF pages, Imagemagick uses the uncropped
-			// area (resulting in unnecessary whitespace) unless the following option is set.
-			$this->image->setOption( 'pdf:use-cropbox', true );
-
 			// Only load the first page.
 			return $this->file . '[0]';
 		} catch ( Exception $e ) {
