Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

异常 #131

Open
Allyns opened this issue Feb 22, 2017 · 1 comment
Open

异常 #131

Allyns opened this issue Feb 22, 2017 · 1 comment

Comments

@Allyns
Copy link

Allyns commented Feb 22, 2017

W/ExifInterface: Invalid image: ExifInterface got an unsupported image format file(ExifInterface supports JPEG and some RAW image formats only) or a corrupted JPEG file to ExifInterface.
java.io.IOException: Invalid marker: 89
at android.media.ExifInterface.getJpegAttributes(ExifInterface.java:1837)
at android.media.ExifInterface.loadAttributes(ExifInterface.java:1475)
at android.media.ExifInterface.(ExifInterface.java:1112)
at cn.finalteam.galleryfinal.widget.crop.CropUtil.getExifRotation(CropUtil.java:59)
at cn.finalteam.galleryfinal.widget.crop.CropImageActivity.setSourceUri(CropImageActivity.java:119)
at cn.finalteam.galleryfinal.PhotoEditActivity.loadImage(PhotoEditActivity.java:385)
at cn.finalteam.galleryfinal.PhotoEditActivity.onCreate(PhotoEditActivity.java:261)
at android.app.Activity.performCreate(Activity.java:6745)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2655)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2788)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1503)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6209)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

@shiguang1120
Copy link

http://blog.csdn.net/jojo2014jojo/article/details/55059390

Uri uri; // the URI you've received from the other app
InputStream in;
try {
  in = getContentResolver().openInputStream(uri);
  ExifInterface exifInterface = new ExifInterface(in);
  // Now you can extract any Exif tag you want
  // Assuming the image is a JPEG or supported raw format
} catch (IOException e) {
  // Handle any errors
} finally {
  if (in != null) {
    try {
      in.close();
    } catch (IOException ignored) {}
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants