Stellen Sie die Bildausrichtung mit ExifInterface ein
setRotation method
imCamera.Parameters
funktioniert nicht bei allen Geräten. Jemand schlägt vor, das manuell zu ändernEXIF
Informationen zur Lösung des Problems. Kannst du mir ein kurzes Beispiel geben, wie man das einstellt?exif
Informationen mitExifInterface
so, dass die Bildausrichtung als Hochformat festgelegt wird?
private int savePicture(byte[] data)
{
File pictureFile = getOutputMediaFile();
if (pictureFile == null)
return FILE_CREATION_ERROR;
try {
FileOutputStream fos = new FileOutputStream(pictureFile);
fos.write(data);
fos.close();
} catch (FileNotFoundException e) {
return FILE_NOT_FOUND;
} catch (IOException e) {
return ACCESSING_FILE_ERROR;
}
return OKAY;
}
Ich habe Folgendes versucht:
try {
ExifInterface exifi = new ExifInterface(pictureFile.getAbsolutePath());
exifi.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_ROTATE_90));
exifi.saveAttributes();
} catch (IOException e) {
Log.e(TAG, "Exif error");
}
aber nichts ändert sich, wenn ich die bilder aus der android gallery visualisiere.