Skip to content

Commit

Permalink
Media: Replace media icon images with SVG.
Browse files Browse the repository at this point in the history
 
Replace the `.png` files in use for media library type icons with `.svg` versions. Improves sharpness, especially on high resolution screens and devices.

Props iseulde, melchoyce, joemcgill, sabernhardt, huzaifaalmesbah, wonderboymusic, ocean90, karmatosed, boemedia, bosskhj, joedolson.
Fixes #31352.

git-svn-id: https://develop.svn.wordpress.org/trunk@57638 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
joedolson committed Feb 15, 2024
1 parent 789e4ab commit c89e050
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/js/_enqueues/vendor/mediaelement/wp-playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
},

renderCurrent : function () {
var dimensions, defaultImage = 'wp-includes/images/media/video.png';
var dimensions, defaultImage = 'wp-includes/images/media/video.svg';
if ( 'video' === this.data.type ) {
if ( this.data.images && this.current.get( 'image' ) && -1 === this.current.get( 'image' ).src.indexOf( defaultImage ) ) {
this.playerNode.attr( 'poster', this.current.get( 'image' ).src );
Expand Down
1 change: 1 addition & 0 deletions src/wp-includes/images/media/archive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/wp-includes/images/media/audio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/wp-includes/images/media/code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/wp-includes/images/media/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/wp-includes/images/media/document.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/wp-includes/images/media/interactive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/wp-includes/images/media/spreadsheet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/wp-includes/images/media/text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/wp-includes/images/media/video.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -6879,7 +6879,7 @@ function wp_mime_type_icon( $mime = 0 ) {
}

$ext = strtolower( substr( $file, -4 ) );
if ( ! in_array( $ext, array( '.png', '.gif', '.jpg' ), true ) ) {
if ( ! in_array( $ext, array( '.svg', '.png', '.gif', '.jpg' ), true ) ) {
if ( is_dir( "$dir/$file" ) ) {
$dirs[ "$dir/$file" ] = "$uri/$file";
}
Expand Down

0 comments on commit c89e050

Please sign in to comment.