@@ -21,7 +21,10 @@
#include "bamReader.h"
static const char * const extensions_android[] = {
- "jpg", "jpeg", "gif", "png",//"webp" (android 4.0+)
+ "jpg", "jpeg", "gif", "png",
+#if __ANDROID_API__ >= 14
+ "webp"
+#endif
};
static const int num_extensions_android = sizeof(extensions_android) / sizeof(const char *);
@@ -87,6 +87,7 @@ Reader(PNMFileType *type, istream *file, bool owns_file, string magic_number) :
jobject opts = _env->CallStaticObjectMethod(jni_PandaActivity,
jni_PandaActivity_readBitmapSize,
(jlong) _file);
+ _file->clear();
_file->seekg(pos);
if (_file->tellg() != pos) {
android_cat.error()
@@ -62,7 +62,7 @@
static const char *const stb_extensions[] = {
// Expose the extensions that we don't already expose through other loaders.
-#ifndef HAVE_JPEG
+#if !defined(HAVE_JPEG) && !defined(ANDROID)
"jpg", "jpeg",
#endif
#ifndef HAVE_PNG