Changeset 47122 for trunk/src/wp-includes/class-wp-image-editor-imagick.php
- Timestamp:
- 01/29/2020 12:43:23 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-imagick.php
r46696 r47122 24 24 public function __destruct() { 25 25 if ( $this->image instanceof Imagick ) { 26 // we don't need the original in memory anymore26 // We don't need the original in memory anymore. 27 27 $this->image->clear(); 28 28 $this->image->destroy(); … … 155 155 } 156 156 157 // Select the first frame to handle animated images properly 157 // Select the first frame to handle animated images properly. 158 158 if ( is_callable( array( $this->image, 'setIteratorIndex' ) ) ) { 159 159 $this->image->setIteratorIndex( 0 ); … … 264 264 } 265 265 266 // Execute the resize 266 // Execute the resize. 267 267 $thumb_result = $this->thumbnail_image( $dst_w, $dst_h ); 268 268 if ( is_wp_error( $thumb_result ) ) { … … 531 531 532 532 if ( $dst_w || $dst_h ) { 533 // If destination width/height isn't specified, use same as534 // width/height from source.533 // If destination width/height isn't specified, 534 // use same as width/height from source. 535 535 if ( ! $dst_w ) { 536 536 $dst_w = $src_w; … … 676 676 677 677 try { 678 // Store initial Format678 // Store initial format. 679 679 $orig_format = $this->image->getImageFormat(); 680 680 … … 682 682 $this->make_image( $filename, array( $image, 'writeImage' ), array( $filename ) ); 683 683 684 // Reset original Format684 // Reset original format. 685 685 $this->image->setImageFormat( $orig_format ); 686 686 } catch ( Exception $e ) { … … 688 688 } 689 689 690 // Set correct file permissions 690 // Set correct file permissions. 691 691 $stat = stat( dirname( $filename ) ); 692 $perms = $stat['mode'] & 0000666; // same permissions as parent folder, strip off the executable bits692 $perms = $stat['mode'] & 0000666; // Same permissions as parent folder, strip off the executable bits. 693 693 chmod( $filename, $perms ); 694 694 … … 715 715 716 716 try { 717 // Temporarily change format for stream 717 // Temporarily change format for stream. 718 718 $this->image->setImageFormat( strtoupper( $extension ) ); 719 719 720 // Output stream of image content 720 // Output stream of image content. 721 721 header( "Content-Type: $mime_type" ); 722 722 print $this->image->getImageBlob(); 723 723 724 // Reset Image to original Format724 // Reset image to original format. 725 725 $this->image->setImageFormat( $this->get_extension( $this->mime_type ) ); 726 726 } catch ( Exception $e ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)