Skip to content

Optimize PNGs in themes and as part of build process #2827

Closed
wants to merge 2 commits into from
View
14 Makefile
@@ -97,7 +97,7 @@ CSSFILES = ${CSSTHEMEFILES} ${CSSSTRUCTUREFILES}
# By default, this is what get runs when make is called without any arguments.
# Min and un-min CSS and JS files are the only things built
-all: init js min css cssmin notify
+all: init js min css cssmin notify images imagesmin
# Build the normal CSS file.
css: init
@@ -113,6 +113,14 @@ cssmin: init css
@@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${CSS} >> ${OUTPUT}/${CSSMIN}
@@java -jar build/yuicompressor-2.4.6.jar --type css ${OUTPUT}/${CSSSTRUCTURE} >> ${OUTPUT}/${CSSSTRUCTUREMIN}
+images: init
+ @@cp -R css/themes/${CSSTHEME}/images ${OUTPUT}/
+
+imagesmin: images
+ @@find ${OUTPUT} -name '*png' -exec optipng -o3 {} \;
+ @@find ${OUTPUT} -name '*png' -exec advpng -z -4 {} \;
+ @@find ${OUTPUT} -name '*png' -exec advdef -z -4 {} \;
+
# Build the normal JS file
js: init
# Build the JavaScript file
@@ -142,11 +150,11 @@ pull:
@@git pull --quiet
# Zip the 4 files and the theme images into one convenient package
-zip: init js min css cssmin
+zip: init js min css cssmin images imagesmin
@@mkdir -p ${DIR}
@@cp ${OUTPUT}/*.js ${DIR}/
@@cp ${OUTPUT}/*.css ${DIR}/
- @@cp -R css/themes/${CSSTHEME}/images ${DIR}/
+ @@cp -R ${OUTPUT}/images ${DIR}/
@@zip -rq ${OUTPUT}/${DIR}.zip ${DIR}
@@rm -fr ${DIR}
View
BIN css/themes/default/images/ajax-loader.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/default/images/icons-18-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/default/images/icons-18-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/default/images/icons-36-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/default/images/icons-36-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/valencia/images/ajax-loader.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/valencia/images/icon-search-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/valencia/images/icons-18-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/valencia/images/icons-18-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/valencia/images/icons-36-black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/valencia/images/icons-36-white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/valencia/images/texture_05.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN css/themes/valencia/images/texture_075.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Something went wrong with that request. Please try again.