Skip to content

Commit

Permalink
Fix auto resize feature using incorrect descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
av3nger committed Nov 15, 2023
1 parent 9a13869 commit 56e136a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Fixed:
* Notices getting injected into plugin navigation
* Do not expose internal methods to WP CLI commands
* WP CLI command only processing the first 10 images
* Auto resize feature using incorrect descriptors

= 1.6.0 - 12.11.2023 =

Expand Down
4 changes: 2 additions & 2 deletions app/modules/class-auto-resize.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function add_srcset_to_image( string $image_dom, Image $image ): string {
break;
}

$srcset[] = $image->get_cf_image() . 'w=' . $size . ' ' . $size . 'px';
$srcset[] = $image->get_cf_image() . 'w=' . $size . ' ' . $size . 'w';
}

unset( $size );
Expand All @@ -90,7 +90,7 @@ public function add_srcset_to_image( string $image_dom, Image $image ): string {
}

// Add the original image to the srcset.
$srcset[] = $image->get_cf_image() . 'w=' . $image->get_width() . ' ' . $image->get_width() . 'px';
$srcset[] = $image->get_cf_image() . 'w=' . $image->get_width() . ' ' . $image->get_width() . 'w';

// Check if there is already a 'sizes' attribute.
$sizes = strpos( $image_dom, ' sizes=' );
Expand Down

0 comments on commit 56e136a

Please sign in to comment.