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

Commit 1043f561 authored by Jaesung Chung's avatar Jaesung Chung
Browse files

ExifInterface: ignore exceptions when getting wrong images

In order to maintain compatibility with the old versions of
ExifInterface, non-JPEG image files, for instance, PNG, GIF and so on,
need to be handled by generating an empty result rather than throwing
an exception in the constructor. And corrupted JPG files also should be
handled in the same way.

Bug: 27587980
Change-Id: If33b63c683bfb672999d1abd370a8edf29932ac1
parent 89cb1945
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -824,7 +824,13 @@ public class ExifInterface {
        }

        // Process JPEG input stream
        try {
            getJpegAttributes(in);
        } catch (IOException e) {
            // Ignore exceptions in order to keep the compatibility with the old versions of
            // ExifInterface.
            Log.w(TAG, "Invalid JPEG", e);
        }

        if (DEBUG) {
            printAttributes();