Avoid pre-processing images when they won't be used

Change-Id: Iffa31228ca95a2e29ccc0aa81bda0fc66922d577
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index b00e276..7ffd43b 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -835,7 +835,9 @@
     bool hasErrors = false;
 
     if (drawables != NULL) {
-        err = preProcessImages(bundle, assets, drawables);
+        if (bundle->getOutputAPKFile() != NULL) {
+            err = preProcessImages(bundle, assets, drawables);
+        }
         if (err == NO_ERROR) {
             err = makeFileResources(bundle, assets, &table, drawables, "drawable");
             if (err != NO_ERROR) {