Make WordPress Core

Changeset 46238


Ignore:
Timestamp:
09/23/2019 10:35:45 AM (6 years ago)
Author:
mikeschroder
Message:

Media: Prevent unnecessary whitespace around PDF Thumbnails.

Stops unintended whitespace from showing around PDF thumbnails
when the PDF creation tool utilized a CropBox.

Props michelweimerskirch, joemcgill.
Fixes #45598.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r46216 r46238  
    788788            $this->image->setResolution( 128, 128 );
    789789
     790            // When generating thumbnails from cropped PDF pages, Imagemagick uses the uncropped
     791            // area (resulting in unnecessary whitespace) unless the following option is set.
     792            $this->image->setOption( 'pdf:use-cropbox', true );
     793
    790794            // Only load the first page.
    791795            return $this->file . '[0]';
Note: See TracChangeset for help on using the changeset viewer.