thumbnail_image example

if ( ! $dims ) {
            return new WP_Error( 'error_getting_dimensions', __( 'Could not calculate resized image dimensions' ) );
        }

        list( $dst_x$dst_y$src_x$src_y$dst_w$dst_h$src_w$src_h ) = $dims;

        if ( $crop ) {
            return $this->crop( $src_x$src_y$src_w$src_h$dst_w$dst_h );
        }

        // Execute the resize.         $thumb_result = $this->thumbnail_image( $dst_w$dst_h );
        if ( is_wp_error( $thumb_result ) ) {
            return $thumb_result;
        }

        return $this->update_size( $dst_w$dst_h );
    }

    /** * Efficiently resize the current image * * This is a WordPress specific implementation of Imagick::thumbnailImage(), * which resizes an image to given dimensions and removes any associated profiles. * * @since 4.5.0 * * @param int $dst_w The destination width. * @param int $dst_h The destination height. * @param string $filter_name Optional. The Imagick filter to use when resizing. Default 'FILTER_TRIANGLE'. * @param bool $strip_meta Optional. Strip all profiles, excluding color profiles, from the image. Default true. * @return void|WP_Error */
Home | Imprint | This part of the site doesn't use cookies.