From 690874b6a9013a3e54f96f7a753bf4bfbfe22aee Mon Sep 17 00:00:00 2001 From: seven332 Date: Sat, 27 Dec 2014 13:16:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=97=A0=E9=99=90=20update?= =?UTF-8?q?=20sercet=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/hippo/ehviewer/util/Secret.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/hippo/ehviewer/util/Secret.java b/src/com/hippo/ehviewer/util/Secret.java index a47d3e9fb..26bd27e0c 100644 --- a/src/com/hippo/ehviewer/util/Secret.java +++ b/src/com/hippo/ehviewer/util/Secret.java @@ -72,7 +72,12 @@ public final class Secret { @Override public void run() { // TODO check usable space - if (!hasSecretImage(mContext)) { + File dir = mContext.getExternalFilesDir(DIR_NAME); + File image = new File(dir, IMAGE_NAME); + BitmapFactory.Options opts = new BitmapFactory.Options(); + opts.inJustDecodeBounds = true; + BitmapFactory.decodeFile(image.getAbsolutePath(), opts); + if (opts.outWidth <= 0 || opts.outHeight <= 0) { // Get image error, try to get image from internet HttpHelper hh = new HttpHelper(mContext); hh.download(SERCET_IMAGE_URL, mContext.getExternalFilesDir(DIR_NAME),