|
|
@@ -200,10 +200,13 @@ public class ActPublishArticle extends BaseActivity {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
jsonObject.put("resource", url);
|
|
|
- if(video.getOrientation() / 90 % 2 == 0 )//0 180
|
|
|
- jsonObject.put("cover", String.format(Locale.CHINA, "%s?vframe/jpg/offset/0&w=%d&h=%d", url, video.getWidth(), video.getHeight()));
|
|
|
- else//90 270
|
|
|
- jsonObject.put("cover", String.format(Locale.CHINA, "%s?vframe/jpg/offset/0&w=%d&h=%d", url, video.getHeight(), video.getWidth()));
|
|
|
+ int a = video.getWidth();
|
|
|
+ int b = video.getHeight();
|
|
|
+ if(video.getOrientation() / 90 % 2 == 1 ) {//90 270
|
|
|
+ a = video.getHeight();
|
|
|
+ b = video.getWidth();
|
|
|
+ }
|
|
|
+ jsonObject.put("cover", String.format(Locale.CHINA, "%s?vframe/jpg/offset/0/rotate/%d&w=%d&h=%d", url, video.getOrientation(), a, b));
|
|
|
publishArticle(dialogProgress);
|
|
|
} else {
|
|
|
ViewUtil.setText(dialogProgress.getTextView(), "上传失败");
|