Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6f4be8e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "ExifInterface: Correct thumbnail compression info"

parents ccdc6b82 4564cbce
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -1938,6 +1938,9 @@ public class ExifInterface {
     * not exist or thumbnail image is uncompressed.
     * not exist or thumbnail image is uncompressed.
     */
     */
    public boolean isThumbnailCompressed() {
    public boolean isThumbnailCompressed() {
        if (!mHasThumbnail) {
            return false;
        }
        if (mThumbnailCompression == DATA_JPEG || mThumbnailCompression == DATA_JPEG_COMPRESSED) {
        if (mThumbnailCompression == DATA_JPEG || mThumbnailCompression == DATA_JPEG_COMPRESSED) {
            return true;
            return true;
        }
        }
@@ -2974,7 +2977,6 @@ public class ExifInterface {
            }
            }
        } else {
        } else {
            // Thumbnail data may not contain Compression tag value
            // Thumbnail data may not contain Compression tag value
            mThumbnailCompression = DATA_JPEG;
            handleThumbnailFromJfif(in, thumbnailData);
            handleThumbnailFromJfif(in, thumbnailData);
        }
        }
    }
    }
@@ -3009,6 +3011,8 @@ public class ExifInterface {
                mHasThumbnail = true;
                mHasThumbnail = true;
                mThumbnailOffset = thumbnailOffset;
                mThumbnailOffset = thumbnailOffset;
                mThumbnailLength = thumbnailLength;
                mThumbnailLength = thumbnailLength;
                mThumbnailCompression = DATA_JPEG;

                if (mFilename == null && mAssetInputStream == null
                if (mFilename == null && mAssetInputStream == null
                        && mSeekableFileDescriptor == null) {
                        && mSeekableFileDescriptor == null) {
                    // Save the thumbnail in memory if the input doesn't support reading again.
                    // Save the thumbnail in memory if the input doesn't support reading again.