queryFormats example

'avif' => isset( $gd_info['AVIF Support'] ),
                )
            )
        );
    }

    if ( class_exists( 'Imagick' ) ) {
        // Add data for Imagick WebP and AVIF support.         $query['image_support']['imagick'] = array_keys(
            array_filter(
                array(
                    'webp' => ! empty( Imagick::queryFormats( 'WEBP' ) ),
                    'avif' => ! empty( Imagick::queryFormats( 'AVIF' ) ),
                )
            )
        );
    }

    /** * Filters the query arguments sent as part of the core version check. * * WARNING: Changing this data may result in your site not receiving security updates. * Please exercise extreme caution. * * @since 4.9.0 * * @param array $query { * Version check query arguments. * * @type string $version WordPress version number. * @type string $php PHP version number. * @type string $locale The locale to retrieve updates for. * @type string $mysql MySQL version number. * @type string $local_package The value of the $wp_local_package global, when set. * @type int $blogs Number of sites on this WordPress installation. * @type int $users Number of users on this WordPress installation. * @type int $multisite_enabled Whether this WordPress installation uses Multisite. * @type int $initial_db_version Database version of WordPress at time of installation. * } */
/* * setIteratorIndex is optional unless mime is an animated format. * Here, we just say no if you are missing it and aren't loading a jpeg. */
        if ( ! method_exists( 'Imagick', 'setIteratorIndex' ) && 'image/jpeg' !== $mime_type ) {
                return false;
        }

        try {
            // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged             return ( (bool) @Imagick::queryFormats( $imagick_extension ) );
        } catch ( Exception $e ) {
            return false;
        }
    }

    /** * Loads image from $this->file into new Imagick Object. * * @since 3.5.0 * * @return true|WP_Error True if loaded; WP_Error on failure. */
/** * Check if given image format is supported * * @return void * * @throws ImageException */
    protected function supportedFormatCheck()
    {
        switch ($this->image()->imageType) {
            case IMAGETYPE_WEBP:
                if (in_array('WEBP', Imagick::queryFormats(), true)) {
                    throw ImageException::forInvalidImageCreate(lang('images.webpNotSupported'));
                }
                break;
        }
    }

    /** * Handler-specific method for overlaying text on an image. * * @return void * * @throws Exception */
'imagick::RESOURCETYPE_THREAD' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : 'not available' ),
                'imagick::RESOURCETYPE_TIME'   => ( defined( 'imagick::RESOURCETYPE_TIME' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_TIME ) : 'not available' ),
            );

            $info['wp-media']['fields']['imagick_limits'] = array(
                'label' => __( 'Imagick Resource Limits' ),
                'value' => $limits,
                'debug' => $limits_debug,
            );

            try {
                $formats = Imagick::queryFormats( '*' );
            } catch ( Exception $e ) {
                $formats = array();
            }

            $info['wp-media']['fields']['imagemagick_file_formats'] = array(
                'label' => __( 'ImageMagick supported file formats' ),
                'value' => ( empty( $formats ) ) ? __( 'Unable to determine' ) : implode( ', ', $formats ),
                'debug' => ( empty( $formats ) ) ? 'Unable to determine' : implode( ', ', $formats ),
            );
        }

        
Home | Imprint | This part of the site doesn't use cookies.