Built-in Image Widget using SVG – Size issues
-
In a custom widget area, I’ve added the built-in Image widget and I’m getting the following error :
Warning: Illegal string offset 'width' in {{PATH_TO_ROOT}} /wp-includes/media.php on line 988
As a reference, this is what I’m seeing between lines 985 and 999 :
function _wp_get_image_size_from_meta( $size_name, $image_meta ) { if ( $size_name === 'full' ) { return array( absint( $image_meta['width'] ), absint( $image_meta['height'] ), ); } elseif ( ! empty( $image_meta['sizes'][$size_name] ) ) { return array( absint( $image_meta['sizes'][$size_name]['width'] ), absint( $image_meta['sizes'][$size_name]['height'] ), ); } return false; }
The issue is with the
$image_meta['width']
when using a SVG. It seems to me like it is not storing any information regarding size. I can understand since it is a vector file, but whenever I enableWP_DEBUG
I get this problem.Thought it would be good to point this out.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Built-in Image Widget using SVG – Size issues’ is closed to new replies.