ifdef and comment out libjpeg

Chances are there are not many themes in widespread use that are
using jpeg images, but this will be easy to revert back or even
just temporarily modify if we need jpeg support in a pinch.

Change-Id: If17b05ce3ebccce724fd74b26ed8ea91b287c3cf
diff --git a/minuitwrp/Android.mk b/minuitwrp/Android.mk
index 39c61c4..ac4c181 100644
--- a/minuitwrp/Android.mk
+++ b/minuitwrp/Android.mk
@@ -55,10 +55,11 @@
     external/libpng \
     external/zlib \
     system/core/include \
-    external/jpeg \
     external/freetype/include \
     external/libcxx/include
 
+#external/jpeg \
+
 ifeq ($(RECOVERY_TOUCHSCREEN_SWAP_XY), true)
 LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_SWAP_XY
 endif
@@ -151,7 +152,8 @@
 LOCAL_CLANG := true
 
 LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
-LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libjpeg libpng libutils
+LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils
+#libjpeg
 LOCAL_STATIC_LIBRARIES += libpixelflinger_twrp
 LOCAL_MODULE_TAGS := eng
 LOCAL_MODULE := libminuitwrp
diff --git a/minuitwrp/resources.cpp b/minuitwrp/resources.cpp
index 781df2b..c4325e4 100644
--- a/minuitwrp/resources.cpp
+++ b/minuitwrp/resources.cpp
@@ -31,9 +31,11 @@
 #include <png.h>
 
 #include <pixelflinger/pixelflinger.h>
+#ifdef TW_INCLUDE_JPEG
 extern "C" {
 #include "jpeglib.h"
 }
+#endif
 #include "minui.h"
 
 #define SURFACE_DATA_ALIGNMENT 8
@@ -251,6 +253,7 @@
     return result;
 }
 
+#ifdef TW_INCLUDE_JPEG
 int res_create_surface_jpg(const char* name, gr_surface* pSurface) {
     GGLSurface* surface = NULL;
     int result = 0, y;
@@ -348,18 +351,23 @@
     }
     return result;
 }
+#endif
 
 int res_create_surface(const char* name, gr_surface* pSurface) {
     int ret;
 
     if (!name)      return -1;
 
+#ifdef TW_INCLUDE_JPEG
     if (strlen(name) > 4 && strcmp(name + strlen(name) - 4, ".jpg") == 0)
         return res_create_surface_jpg(name,pSurface);
+#endif
 
     ret = res_create_surface_png(name,pSurface);
+#ifdef TW_INCLUDE_JPEG
     if (ret < 0)
         ret = res_create_surface_jpg(name,pSurface);
+#endif
 
     return ret;
 }