zetbaitsu / Compressor

An android image compression library.
7.08k stars 963 forks source link

code meaning #17

Open zhangkuo0216 opened 7 years ago

zhangkuo0216 commented 7 years ago

what is meaning of if (bmp == null) { InputStream inputStream = null; try { inputStream = new FileInputStream(filePath); BitmapFactory.decodeStream(inputStream, null, options); inputStream.close(); } catch (FileNotFoundException exception) { exception.printStackTrace(); } catch (IOException exception) { exception.printStackTrace(); } } why add that after Bitmap bmp = BitmapFactory.decodeFile(filePath, options);

zetbaitsu commented 7 years ago

Its alternative for when decodeFile fails, https://github.com/zetbaitsu/Compressor/commit/ff6d276d5952efe78c35df8c12a24016c0c3150a