File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -870,8 +870,9 @@ public function find_attachment_size_urls() {
870870 if ( true === $ auto_sync ) {
871871 $ this ->sync ->add_to_sync ( $ result ->post_id );
872872 }
873- $ size = $ this ->get_sized ( $ result ->post_id );
874- $ cached [ $ size ['sized_url ' ] ] = (int ) $ result ->post_id ;
873+ $ size = $ this ->get_sized ( $ result ->post_id );
874+ $ key = ! empty ( $ size ['sized_url ' ] ) ? $ size ['sized_url ' ] : wp_get_attachment_url ( $ result ->post_id );
875+ $ cached [ $ key ] = (int ) $ result ->post_id ;
875876 }
876877 }
877878 wp_cache_add ( $ key , $ cached );
@@ -1304,7 +1305,7 @@ public function parse_element( $element ) {
13041305
13051306 // Check if this is a crop or a scale.
13061307 $ has_size = $ this ->media ->get_size_from_url ( $ this ->sanitize_url ( $ raw_url ) );
1307- if ( ! empty ( $ has_size ) ) {
1308+ if ( ! empty ( $ has_size ) && ! empty ( $ item [ ' height ' ] ) ) {
13081309 $ file_ratio = round ( $ has_size [0 ] / $ has_size [1 ], 2 );
13091310 $ original_ratio = round ( $ item ['width ' ] / $ item ['height ' ], 2 );
13101311 if ( $ file_ratio !== $ original_ratio ) {
You can’t perform that action at this time.
0 commit comments