Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #30587, comment 3


Ignore:
Timestamp:
12/03/2014 10:55:09 PM (12 years ago)
Author:
netweb

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30587, comment 3

    initial v1  
    44
    55> If I remember correctly, the reason we don't touch default themes is that we don't want to compress the screenshots.  This seems like something we can write a configuration against.
    6 Easy enough, see inline patch:
     6Easy enough, see inline patch: (Edit: Updated to exclude 3rd party Genericons library)
    77
    88{{{
    … …  
    1212--- Gruntfile.js        (revision 30594)
    1313+++ Gruntfile.js        (working copy)
    14 @@ -416,7 +416,9 @@
     14@@ -416,7 +416,10 @@
    1515                                cwd: SOURCE_DIR,
    1616                                src: [
    … …  
    1919+                                       'wp-includes/js/tinymce/skins/wordpress/images/*.{png,jpg,gif,jpeg}',
    2020+                                       'wp-content/themes/twenty*/**/*.{png,jpg,gif,jpeg,svg}',
    21 +                                       '!wp-content/themes/twenty*/screenshot.png'
     21+                                       '!wp-content/themes/twenty*/screenshot.png',
     22+                                       '!wp-content/themes/twenty*/**/{Genericons.svg,genericons-regular-webfont.svg}'
    2223                                ],
    2324                                dest: SOURCE_DIR
    … …  
    3132With all that said though, all current included themes images are fully optimized with a single exception:
    3233`src/wp-content/themes/twentyfifteen/genericons/Genericons.svg (saved 62 B - 0%)`
     34
     35'''EDIT''': Turns out this is not true, even though running a test of the above patch eight files were actually optimized/minified during the task even though the grunt output stated `(already optimized)`, the eight files are:
     36{{{
     37src/wp-content/themes/twentyeleven/inc/images/dark.png (already optimized)
     38src/wp-content/themes/twentyeleven/inc/images/light.png (already optimized)
     39src/wp-content/themes/twentyfourteen/images/pattern-dark.svg (already optimized)
     40src/wp-content/themes/twentyfourteen/images/pattern-light.svg (already optimized)
     41src/wp-content/themes/twentythirteen/images/headers/circle-thumbnail.png (already optimized)
     42
     43src/wp-content/themes/twentythirteen/genericons/font/genericons-regular-webfont.svg (already optimized)
     44src/wp-content/themes/twentyfourteen/genericons/font/genericons-regular-webfont.svg (already optimized)
     45src/wp-content/themes/twentyfifteen/genericons/Genericons.svg (saved 62 B - 0%)
     46}}}
    3347
    3448And if I remember correctly before an included theme is shipped/released all images are manually optimized and committed to the repo.
    … …  
    4761At this stage there may be some improvements by switching to another algorithm then we would switch to this algorithm for all images, not just included themes, we would also then replace the current `grunt-contrib-imagemin` task with the new replacement or replacements.
    4862
    49 Recommending this be closed and resolved as 'worksforme'
     63~~Recommending this be closed and resolved as 'worksforme'~~
     64
     65Adding a patch per the above to minify bundled theme images excluding Genericons 3rd party external library.