Skip to content

Commit

Permalink
1.0.1 - 增加通过比例宽高获取缩略图
Browse files Browse the repository at this point in the history
  • Loading branch information
xiandanin committed Jun 5, 2017
1 parent 367fb96 commit fe2b350
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ext {
android =
[
versionCode : 1,
versionName : "1.0.0",
versionName : "1.0.1",

compileSdkVersion: 25,
buildToolsVersion: "25.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ public Bitmap getScaledFrameAtTime(long timeUs, int option, int width, int heigh
return frame;
}

public Bitmap getScaledFrameAtTime(long timeUs, int option, float widthScale, float heightScale, float rotate) {
String widthText = extractMetadata(METADATA_KEY_VIDEO_WIDTH);
String heightText = extractMetadata(METADATA_KEY_VIDEO_HEIGHT);
int width = TextUtils.isEmpty(widthText) ? 0 : (int) (Integer.parseInt(widthText) * widthScale);
int height = TextUtils.isEmpty(heightText) ? 0 : (int) (Integer.parseInt(heightText) * heightScale);
return getScaledFrameAtTime(timeUs, option, width, height, rotate);
}

public byte[] getEmbeddedPicture() {
return impl.getEmbeddedPicture();
}
Expand Down

0 comments on commit fe2b350

Please sign in to comment.