A. java实现图片旋转90度的问题
翻转来后源 orientation 属性为6 。
public static void main(String[] args) throws ImageProcessingException, IOException {
File jpegFile= new File("C:\\Users\\Administrator\\Desktop\\IMG_0362.JPG");
Metadata metadata = ImageMetadataReader.readMetadata(jpegFile);
Directory directory = metadata.getDirectory(ExifIFD0Directory.class);
JpegDirectory jpegDirectory = (JpegDirectory)metadata.getDirectory(JpegDirectory.class);
// int orientation =0;
B. java翻转字符串
importjava.util.Scanner;
publicclassTurnString{
publicstaticvoidmain(String[]args){
Scannersc=newScanner(System.in);
System.out.println("输入字符版串");
Stringstr=sc.next();
System.out.println("翻转前:权"+str);
Strings="";
for(inti=str.length()-1;i>=0;--i)
s+=str.charAt(i);
System.out.println("翻转后:"+s);
}
}