Giter Site home page Giter Site logo

Comments (6)

jinke1984 avatar jinke1984 commented on July 19, 2024

是android.media.ExifInterface,具体请教下你的那张处理方式的原理?谢谢!

from smartcamera.

pqpo avatar pqpo commented on July 19, 2024

android.media.ExifInterface 的构造函数看来只支持 AssetManager.AssetInputStream 和 FileInputStream

public ExifInterface(InputStream inputStream) throws IOException {
        if (inputStream == null) {
            throw new IllegalArgumentException("inputStream cannot be null");
        }
        mFilename = null;
        if (inputStream instanceof AssetManager.AssetInputStream) {
            mAssetInputStream = (AssetManager.AssetInputStream) inputStream;
            mSeekableFileDescriptor = null;
        } else if (inputStream instanceof FileInputStream
                && isSeekableFD(((FileInputStream) inputStream).getFD())) {
            mAssetInputStream = null;
            mSeekableFileDescriptor = ((FileInputStream) inputStream).getFD();
        } else {
            mAssetInputStream = null;
            mSeekableFileDescriptor = null;
        }
        mIsInputStream = true;
        loadAttributes(inputStream);
    }

FormatTools.getInstance().Byte2InputStream(data) 返回的是 FileInputStream ?

https://github.com/pqpo/SmartCamera/blob/master/smartcameralib/src/main/java/me/pqpo/smartcameralib/utils/BitmapUtil.java 这段代码来自于老版本的安卓源码,具体就是解析 Exif 格式的头信息读取旋转角度。

from smartcamera.

jinke1984 avatar jinke1984 commented on July 19, 2024

FormatTools.getInstance().Byte2InputStream(data)这个方法是将将byte转换成InputStream

from smartcamera.

pqpo avatar pqpo commented on July 19, 2024

new ByteArrayInputStream(data); ?

from smartcamera.

jinke1984 avatar jinke1984 commented on July 19, 2024

嗯!是啊!

from smartcamera.

pqpo avatar pqpo commented on July 19, 2024

好的,了解

from smartcamera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.