Make WordPress Core


Ignore:
Timestamp:
11/04/2015 09:43:44 PM (9 years ago)
Author:
azaozz
Message:

Responsive images: do not generate srcset for GIFs that are inserted at full size. Prevents breaking animated GIFs.

Props joemcgill.
Fixes #34528.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r35498 r35524  
    981981    // Bail early if error/no width.
    982982    if ( $image_width < 1 ) {
     983        return false;
     984    }
     985
     986    // Don't add srcset attributes to (animated) gifs that are inserted at full size.
     987    if ( isset( $image_sizes['thumbnail']['mime-type'] ) && 'image/gif' === $image_sizes['thumbnail']['mime-type'] &&
     988        false !== strpos( $image_src, $image_meta['file'] ) ) {
     989
    983990        return false;
    984991    }
Note: See TracChangeset for help on using the changeset viewer.