Decoding adjustmentData in .AAE files of pictures taken by the iPhone

Viewed 579

I understant .AAE files are supposed to describe the changes that were applied to a certain picture. However I see that most times (apparently not always) there is such a file even when they seem to carry the same data (which seems to indicate that no change was applied to the picture.

Does anyone know how to decode this adjustmentData value?

Example photo 1:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>adjustmentBaseVersion</key>
    <integer>0</integer>
    <key>adjustmentData</key>
    <data>
    bZBNT8JAEIb/y5wrKaBg9mbwIBdJNNGD8TC003bNfjS7U5CQ/nenW0o4eNt95+t9nzNY
    YiyREdQZLEam8EK6bhjUfb5cZBftU5fcgFosVo8Z+KDJMbL2DtSqz6DywSJ/UIhJmmdw
    GN9bV/lh8b7Tpnzt7J4CKJivnx9yyADb9joD8o9FQxbf6KBHLc+gNcjDdmnQu3eQW1j+
    dJGtGIigvs7/3CaHe0MlKA4dyVZi1q6Og48THtNaSVBrh2YTfDv1/e6SmOrRYhACFZoo
    leMYfuRxmtqWa0EROeBAi9yTqw2BupNp7Nhfh5sLzRFd4V0acTxRzm/FC+YhuOZieEli
    XUpYXenELjmeiG9vK4W3MyFqaNY2Xgz03/0f
    </data>
    <key>adjustmentEditorBundleID</key>
    <string>com.apple.camera</string>
    <key>adjustmentFormatIdentifier</key>
    <string>com.apple.photo</string>
    <key>adjustmentFormatVersion</key>
    <string>1.6</string>
    <key>adjustmentTimestamp</key>
    <date>2020-03-21T17:37:31Z</date>
</dict>
</plist>

Example photo2:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>adjustmentBaseVersion</key>
    <integer>0</integer>
    <key>adjustmentData</key>
    <data>
    bZBNT8JAEIb/y5wrKaBg9mbwIBdJNNGD8TC003bNfjS7U5CQ/nenW0o4eNt95+t9nzNY
    YiyREdQZLEam8EK6bhjUfb5cZBftU5fcgFosVo8Z+KDJMbL2DtSqz6DywSJ/UIhJmmdw
    GN9bV/lh8b7Tpnzt7J4CKJivnx9yyADb9joD8o9FQxbf6KBHLc+gNcjDdmnQu3eQW1j+
    dJGtGIigvs7/3CaHe0MlKA4dyVZi1q6Og48THtNaSVBrh2YTfDv1/e6SmOrRYhACFZoo
    leMYfuRxmtqWa0EROeBAi9yTqw2BupNp7Nhfh5sLzRFd4V0acTxRzm/FC+YhuOZieEli
    XUpYXenELjmeiG9vK4W3MyFqaNY2Xgz03/0f
    </data>
    <key>adjustmentEditorBundleID</key>
    <string>com.apple.camera</string>
    <key>adjustmentFormatIdentifier</key>
    <string>com.apple.photo</string>
    <key>adjustmentFormatVersion</key>
    <string>1.6</string>
    <key>adjustmentTimestamp</key>
    <date>2020-03-25T05:45:21Z</date>
</dict>
</plist>
1 Answers

Unfortunately this is not a full answer yet. It might help some, but there's something more that I don't understand.

The most useful answer I found came from http://rae.tnir.org/archives/2016/02/data-inside-apples-aae-files. He takes the contents of the data attribute and runs it through a base64 decoder. This then gives him a binary plist, which he converts to intelligible XML related to slow motion settings on the photo.

Let's do it in more detail.

Start with his adjustmentData info:

    <key>adjustmentData</key>
    <data>
    YnBsaXN0MDDRAQJac2xvd01vdGlvbtIDBAUXV3JlZ2lvbnNUcmF0ZaEG0QcIWXRpbWVS
    YW5nZdIJCgsUVXN0YXJ0WGR1cmF0aW9u1AwNDg8QERITVWZsYWdzVXZhbHVlWXRpbWVz
    Y2FsZVVlcG9jaBABEQEMEQJYEADUDA0ODxUWEhMQAxEC4SI+AAAACAsWGyMoKi03PEJL
    VFpganBydXh6g4WIAAAAAAAAAQEAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAI0=
    </data>

We're going to base64 decode the data value. Whitespace and line breaks don't seem to matter. Use https://www.opinionatedgeek.com/codecs/base64decoder because we're going to want to save the result as it itself is binary and converters that just show text results won't be able to render it appropriately. Copy the data field (YnBs.....AAI0=), decode it, and download the resulting file. Note that it starts with bplist, indicating it's a binary plist for use in the Apple ecosystem.

Now we need to decode the binary plist. He doesn't explain how to do it, but other sites claim you can just open it up in TextMate and it knows how to display it. Indeed. The other Apple suggestion in a comment above is to run plutil -convert xml1 TheDownloadedFile, and it modifies the file in-place from the binary version to an XML version. (These do seem to work on the Mac I borrowed to test it.) I'm on Windows though, and neither suggestion helps. I was able to find a Notepad++ bplist plugin for Notepad++ however. The end result for me as displayed in Notepad++ is

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>slowMotion</key>
    <dict>
        <key>regions</key>
        <array>
            <dict>
                <key>timeRange</key>
                <dict>
                    <key>start</key>
                    <dict>
                        <key>flags</key>
                        <integer>1</integer>
                        <key>value</key>
                        <integer>268</integer>
                        <key>timescale</key>
                        <integer>600</integer>
                        <key>epoch</key>
                        <integer>0</integer>
                    </dict>
                    <key>duration</key>
                    <dict>
                        <key>flags</key>
                        <integer>3</integer>
                        <key>value</key>
                        <integer>737</integer>
                        <key>timescale</key>
                        <integer>600</integer>
                        <key>epoch</key>
                        <integer>0</integer>
                    </dict>
                </dict>
            </dict>
        </array>
        <key>rate</key>
        <real>0.125000</real>
    </dict>
</dict>
</plist>

See also decoding data from plist file. The writeup linked in a comment there was very helpful as well. His plist is not an AAE image, but the same process works. I would have suspected it would for any plist.

Except yours. And mine. I don't know why.

The adjustmentData data value in this original question isn't decoding to something starting with bplist. The same decoder (https://www.opinionatedgeek.com/codecs/base64decoder) is decoding it to:

mO@@†˜+) 箠I4у൓0´v̾4»þ§J8xڽ誽ŸXb,‘ҙ,F¦Bºӽ¾d쓗܀Z,V籲ϠPˆšpޛWΐ¦(˜Ÿrƀܶ:ࠨG-Ϡ5ɃviлwXþ‘ˆ¾ÿ&‡C%(Ȗb֮ŽҚIPk‡|;˜Тš•~㱚ږkA9@‹“
“헟‡ˑ]ۚq<QͯË䡸塸Ib]JX]ꂮ9žoo+…3!jhԶ^ໟ

I had no better success with any other decoder, or messing with whitespace. And I'm having the same issue with the AAE that led me into this mess myself. I note that both you and me have data with frequent / characters and that the two success stories I have linked do not. They "feel" like different encodings to me, but I am not an encoding expert.

I'm also a bit suspicious of the adjustmentFormatVersion in the original AAE. The working example was way back on 1.1. Ours are 1.4 and 1.6. I wonder if the contents used to be a binary plist but no longer are.

Related