Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    looks like a bug, can you open up wp-content/plugins/autoptimize/classes/autoptimizeExtra.php and on (around) line 366 change

            // extract img tags.
            if ( preg_match_all( '#<img[^>]*src[^>]*>#Usmi', $in, $matches ) ) {
                foreach ( $matches[0] as $tag ) {
                    $orig_tag = $tag;
    
                    // first do (data-)srcsets.

    into:

            // extract img tags.
            if ( preg_match_all( '#<img[^>]*src[^>]*>#Usmi', $in, $matches ) ) {
                foreach ( $matches[0] as $tag ) {
                    $orig_tag = $tag;
                    $imgopt_w = '';
                    $imgopt_h = '';
    
                    // first do (data-)srcsets.

    and then on (around) line 390 change

                // proceed with img src.
                // first get width and height and add to $imgopt_size.
                if ( preg_match( '#width=("|\')(.*)("|\')#Usmi', $tag, $width ) )  {

    into

                // proceed with img src.
                // first get width and height and add to $imgopt_size.
                $imgopt_w = '';
                $imgopt_h = '';
    
                if ( preg_match( '#width=("|\')(.*)("|\')#Usmi', $tag, $width ) )  {

    And test if that change fixes things?

    frank

    Thread Starter tabasco86

    (@tabasco86)

    perfect, works!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    super, this will be in 2.4.1, out hopefully later this week. thanks for the help Amir!

    Thread Starter tabasco86

    (@tabasco86)

    Pleasure, thank you for the great work!

    Have a good week

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CSS issues with images’ is closed to new replies.