Skip to content

Commit

Permalink
complete when getting a null frame instance
Browse files Browse the repository at this point in the history
  • Loading branch information
JBerendes authored and Shahen Hovhannisyan committed Apr 25, 2017
1 parent 0f0950a commit 451127d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions android/src/main/java/com/shahenlibrary/Trimmer/Trimmer.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public static void getPreviewImages(String path, Promise promise, ReactApplicati

for (int i = 0; i < duration; i += duration / 10) {
Bitmap frame = retriever.getFrameAtTime(i * 1000);
if(frame == null) {
continue;
}
Bitmap currBmp = Bitmap.createScaledBitmap(frame, resizeWidth, resizeHeight, false);

Bitmap normalizedBmp = Bitmap.createBitmap(currBmp, 0, 0, resizeWidth, resizeHeight, mx, true);
Expand Down

0 comments on commit 451127d

Please sign in to comment.