皆さんこんにちは。
輸入品で困っています。JpegImageMetadata
インポートでエラーが表示されます。それらを削除すると、、、、、をタイプSanselan
に解決できません。ImageReadException
TiffImageMetadata
ExifTagConstants
私は Android 2.3.3 を使用していますが、Android 3.2 も試しましたが、同じ問題がありました。インポートは次のとおりです。
import org.apache.sanselan.ImageReadException;
import org.apache.sanselan.Sanselan;
import org.apache.sanselan.formats.jpeg.JpegImageMetadata;
import org.apache.sanselan.formats.tiff.TiffImageMetadata;
import org.apache.sanselan.formats.tiff.constants.ExifTagConstants;
そして、これはエラーを示しているコードの他の部分です (必要に応じてコード全体を投稿できます)。
private int degreeRotated(String filePath) {
try {
JpegImageMetadata meta = ((JpegImageMetadata) Sanselan.getMetadata(new File(filePath)));
TiffImageMetadata data = null;
if (meta != null) {
data = meta.getExif();
}
int orientation = 0;
if (data != null) {
orientation = data.findField(ExifTagConstants.EXIF_TAG_ORIENTATION).getIntValue();
} else {
String[] projection = { Images.ImageColumns.ORIENTATION };
Cursor c = getContentResolver().query(Uri.fromFile(new File(filePath)), projection, null, null, null);
if (c != null && c.moveToFirst()) {
orientation = c.getInt(0);
}
}
switch (orientation) {
case 6:
return 90;
case 8:
return 270;
default:
return 0;
}
/*
* } catch (JpegProcessingException e1) { e1.printStackTrace(); }
* catch (MetadataException e) { e.printStackTrace(); }
*/} catch (ImageReadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return 0;
}
そして、これはエラーログです:
Description Resource Path Location Type
ImageReadException cannot be resolved to a type Viewer.java /Main/src/com/owleyes/moustache line 687 Java Problem
ExifTagConstants cannot be resolved to a variable Viewer.java /Main/src/com/owleyes/moustache line 666 Java Problem
TiffImageMetadata cannot be resolved to a type Viewer.java /Main/src/com/owleyes/moustache line 660 Java Problem
Sanselan cannot be resolved Viewer.java /Main/src/com/owleyes/moustache line 659 Java Problem
JpegImageMetadata cannot be resolved to a type Viewer.java /Main/src/com/owleyes/moustache line 659 Java Problem
JpegImageMetadata cannot be resolved to a type Viewer.java /Main/src/com/owleyes/moustache line 659 Java Problem
The import org.apache.sanselan cannot be resolved Viewer.java /Main/src/com/owleyes/moustache line 11 Java Problem
The import org.apache.sanselan cannot be resolved Viewer.java /Main/src/com/owleyes/moustache line 10 Java Problem
The import org.apache.sanselan cannot be resolved Viewer.java /Main/src/com/owleyes/moustache line 9 Java Problem
The import org.apache.sanselan cannot be resolved Viewer.java /Main/src/com/owleyes/moustache line 8 Java Problem
The import org.apache.sanselan cannot be resolved Viewer.java /Main/src/com/owleyes/moustache line 7 Java Problem