Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

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

    r46696 r47122  
    2424        public function __destruct() {
    2525                if ( $this->image instanceof Imagick ) {
    26                         // we don't need the original in memory anymore
     26                        // We don't need the original in memory anymore.
    2727                        $this->image->clear();
    2828                        $this->image->destroy();
     
    155155                        }
    156156
    157                         // Select the first frame to handle animated images properly
     157                        // Select the first frame to handle animated images properly.
    158158                        if ( is_callable( array( $this->image, 'setIteratorIndex' ) ) ) {
    159159                                $this->image->setIteratorIndex( 0 );
     
    264264                }
    265265
    266                 // Execute the resize
     266                // Execute the resize.
    267267                $thumb_result = $this->thumbnail_image( $dst_w, $dst_h );
    268268                if ( is_wp_error( $thumb_result ) ) {
     
    531531
    532532                        if ( $dst_w || $dst_h ) {
    533                                 // If destination width/height isn't specified, use same as
    534                                 // width/height from source.
     533                                // If destination width/height isn't specified,
     534                                // use same as width/height from source.
    535535                                if ( ! $dst_w ) {
    536536                                        $dst_w = $src_w;
     
    676676
    677677                try {
    678                         // Store initial Format
     678                        // Store initial format.
    679679                        $orig_format = $this->image->getImageFormat();
    680680
     
    682682                        $this->make_image( $filename, array( $image, 'writeImage' ), array( $filename ) );
    683683
    684                         // Reset original Format
     684                        // Reset original format.
    685685                        $this->image->setImageFormat( $orig_format );
    686686                } catch ( Exception $e ) {
     
    688688                }
    689689
    690                 // Set correct file permissions
     690                // Set correct file permissions.
    691691                $stat  = stat( dirname( $filename ) );
    692                 $perms = $stat['mode'] & 0000666; //same permissions as parent folder, strip off the executable bits
     692                $perms = $stat['mode'] & 0000666; // Same permissions as parent folder, strip off the executable bits.
    693693                chmod( $filename, $perms );
    694694
     
    715715
    716716                try {
    717                         // Temporarily change format for stream
     717                        // Temporarily change format for stream.
    718718                        $this->image->setImageFormat( strtoupper( $extension ) );
    719719
    720                         // Output stream of image content
     720                        // Output stream of image content.
    721721                        header( "Content-Type: $mime_type" );
    722722                        print $this->image->getImageBlob();
    723723
    724                         // Reset Image to original Format
     724                        // Reset image to original format.
    725725                        $this->image->setImageFormat( $this->get_extension( $this->mime_type ) );
    726726                } catch ( Exception $e ) {
Note: See TracChangeset for help on using the changeset viewer.