-1
我發現普通圖像庫最符合我的需求,但缺乏此庫使用的示例。 有沒有人有一個例子如何旋轉jpeg圖像無損(即通過只更改文件元數據)? 謝謝!通過普通圖像旋轉的無損圖像示例
我發現普通圖像庫最符合我的需求,但缺乏此庫使用的示例。 有沒有人有一個例子如何旋轉jpeg圖像無損(即通過只更改文件元數據)? 謝謝!通過普通圖像旋轉的無損圖像示例
有一類RotatedIcon(參見鏈接),可以像這樣
if (imageOrientation.equals("3")) {
rotatedIcon = new RotatedIcon(imageIcon, RotatedIcon.Rotate.UPSIDE_DOWN);
} else if (imageOrientation.equals("6")) {
rotatedIcon = new RotatedIcon(imageIcon, RotatedIcon.Rotate.DOWN);
} else if (imageOrientation.equals("8")) {
rotatedIcon = new RotatedIcon(imageIcon, RotatedIcon.Rotate.UP);
}
imageOrientation使用是圖像元數據的屬性(例如,EXIF)
你好, 謝謝你的答案,但我想要的是旋轉圖像無損,保留EXIF數據在圖片。 至少有兩個圖書館,可能會有訣竅:LLJTran和Commons Imaging(來自Sanselan)。 LLJTran不支持一些現代EXIF字段,因此我想用Apache Commons Imaging旋轉JPEG,但無法找到它的代碼示例。 – 2015-02-16 08:14:58