WordPress at a glance
function is not described

wp_getimagesize() WP 5.7.0

Allows PHP's getimagesize() to be debuggable when necessary.

No Hooks.

Return

Array|false. Array of image information or false on failure.

Usage

wp_getimagesize( $filename, $imageinfo );
$filename(string) (required) (passed by reference — &)
The file path.
$imageinfo(array) (passed by reference — &)
Extended image information, passed by reference.

Changelog

Since 5.7.0 Introduced.

Code of wp_getimagesize() WP 5.7

<?php
function wp_getimagesize( $filename, &$imageinfo = array() ) {
	if (
		// Skip when running unit tests.
		! defined( 'WP_RUN_CORE_TESTS' )
		&&
		// Return without silencing errors when in debug mode.
		defined( 'WP_DEBUG' ) && WP_DEBUG
	) {
		return getimagesize( $filename, $imageinfo );
	}

	/*
	 * Silencing notice and warning is intentional.
	 *
	 * getimagesize() has a tendency to generate errors, such as
	 * "corrupt JPEG data: 7191 extraneous bytes before marker",
	 * even when it's able to provide image size information.
	 *
	 * See https://core.trac.wordpress.org/ticket/42480
	 *
	 * phpcs:ignore WordPress.PHP.NoSilencedErrors
	 */
	return @getimagesize( $filename, $imageinfo );
}