Open zhangkuo0216 opened 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);
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(); } }
Bitmap bmp = BitmapFactory.decodeFile(filePath, options);
Its alternative for when decodeFile fails, https://github.com/zetbaitsu/Compressor/commit/ff6d276d5952efe78c35df8c12a24016c0c3150a
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 afterBitmap bmp = BitmapFactory.decodeFile(filePath, options);