From c64b9232ef5bf4f64813f2cf051e4a89aebedf64 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:47:06 +0000 Subject: [PATCH] Built release for 0.5.1. For a full change log look at the notes within the original/0.5.1 release. --- build.json | 2 +- inc/cropper/namespace.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.json b/build.json index 181096c..ac66f48 100644 --- a/build.json +++ b/build.json @@ -1 +1 @@ -{"owner":"humanmade","repo":"smart-media","sha":"326e3f5490759e2042be2e220c84a5615e2233e4","ref":"refs/tags/0.5.0","tagName":"0.5.0","branch":"gh-actions","tags":["0.5.0"],"updated_at":"2024-04-02T14:20:07.205Z"} \ No newline at end of file +{"owner":"humanmade","repo":"smart-media","sha":"517290b015c1c09e7fc84db8671aeeda3deea5e0","ref":"refs/tags/0.5.1","tagName":"0.5.1","branch":"gh-actions","tags":["0.5.1"],"updated_at":"2024-04-03T12:47:06.638Z"} \ No newline at end of file diff --git a/inc/cropper/namespace.php b/inc/cropper/namespace.php index 50a0933..0ab5f23 100644 --- a/inc/cropper/namespace.php +++ b/inc/cropper/namespace.php @@ -960,7 +960,11 @@ function img_tag_add_attr( bool $value, string $image ) : bool { * @param array $image_meta The attachment meta data. * @return false|array Returns an array of [width, height] on success, false on failure. */ -function get_img_src_dimensions( string $image_src, array $image_meta ) { +function get_img_src_dimensions( $image_src, $image_meta ) { + if ( empty( $image_meta ) ) { + return $image_src; + } + // Bail early if an image has been inserted and later edited. list( $image_path ) = explode( '?', $image_src ); if ( preg_match( '/-e[0-9]{13}/', $image_meta['file'], $img_edit_hash ) &&