Complete tree image optimization

- recursively optimize images using optipng/jpegoptim
benefits:
+ reduces image size
+ decreases load time
+ reduces memory usage
This commit is contained in:
Tad 2019-08-05 20:34:08 -04:00
parent aee6b66dd8
commit 3f8e9a846b
7 changed files with 12 additions and 1 deletions

@ -1 +1 @@
Subproject commit 849a37e021f84355a75df6bf95c3587503bef065
Subproject commit e621fe0adf3709dbcf9ac916593396d10cb60836

View File

@ -175,6 +175,12 @@ enableVerity() {
}
export -f enableVerity;
optimizeImagesRecursive() {
find "$1" -type f -name "*.jp*g" -print0 | xargs -0 -n1 -P 16 jpegoptim;
find "$1" -type f -name "*.png" -print0 | xargs -0 -n1 -P 16 optipng;
}
export -f optimizeImagesRecursive;
hardenLocationConf() {
gpsConfig=$1;
#Attempt to get the real device directory

View File

@ -48,6 +48,7 @@ export -f buildDeviceDebug;
buildAll() {
if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanWorkspaceForMalware; fi;
if [ "$DOS_OPTIMIZE_IMAGES" = true ]; then optimizeImagesRecursive "$DOS_BUILD_BASE"; fi;
#Select devices are userdebug due to SELinux policy issues
brunch lineage_nex-user;
}

View File

@ -48,6 +48,7 @@ export -f buildDeviceDebug;
buildAll() {
if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanWorkspaceForMalware; fi;
if [ "$DOS_OPTIMIZE_IMAGES" = true ]; then optimizeImagesRecursive "$DOS_BUILD_BASE"; fi;
#Select devices are userdebug due to SELinux policy issues
brunch lineage_clark-user;
brunch lineage_thor-userdebug;

View File

@ -48,6 +48,7 @@ export -f buildDeviceDebug;
buildAll() {
if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanWorkspaceForMalware; fi;
if [ "$DOS_OPTIMIZE_IMAGES" = true ]; then optimizeImagesRecursive "$DOS_BUILD_BASE"; fi;
brunch lineage_d852-user;
brunch lineage_angler-user;
brunch lineage_bullhead-user;

View File

@ -48,6 +48,7 @@ export -f buildDeviceDebug;
buildAll() {
if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanWorkspaceForMalware; fi;
if [ "$DOS_OPTIMIZE_IMAGES" = true ]; then optimizeImagesRecursive "$DOS_BUILD_BASE"; fi;
brunch lineage_mako-user;
brunch lineage_bacon-user;
brunch lineage_ether-user;

View File

@ -44,6 +44,7 @@ export DOS_MALWARE_SCAN_ENABLED=true; #Set true to perform a fast scan on patchW
export DOS_MALWARE_SCAN_SETTING="quick"; #buildAll() scan speed. Options: quick, extra, slow, full
export DOS_MICROG_INCLUDED="NLP"; #Determines inclusion of microG. Options: NLP, FULL
export DOS_NON_COMMERCIAL_USE_PATCHES=false; #Switch to false to prevent inclusion of non-commercial use patches XXX: Unused, see 1dc9247
export DOS_OPTIMIZE_IMAGES=true; #Set true to apply lossless optimizations to image resources. Reduces image size and increases performance.
export DOS_OVERCLOCKS_ENABLED=false; #Switch to false to disable overclocks #XXX: Most devices have their processors directly under their RAM, heatsinking is mostly into the ground plane, potentially inflicting damage to RAM and the processor itself
export DOS_STRONG_ENCRYPTION_ENABLED=false; #Switch to true to enable AES-256bit encryption on 14.1+15.1 XXX: THIS WILL **DESTROY** EXISTING INSTALLS!
export DOS_WIREGUARD_INCLUDED=false; #Switch to true to enable WireGuard kernel module inclusion