wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_getimagesize › WordPress Function
Since5.7.0
Deprecatedn/a
› wp_getimagesize ( $filename, $imageinfo = array() )
Parameters: (2) |
|
Returns: |
|
Defined at: |
|
Codex: |
Allows PHP's getimagesize() to be debuggable when necessary.
Related Functions: wp_get_image_mime, wp_create_image_subsizes, wp_get_image_editor, _wp_get_image_size_from_meta, has_image_size
Source
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 ); }