Home

Awesome

Exif Thumbnail Adder

This application for android devices searches for pictures (JPEG) on your device and adds a thumbnail if they don't have one yet. Thumbnails are added to the EXIF metadata structure.

It is designed to work from android Oreo (android 8, SDK 26).

Please report issues here: https://github.com/tenzap/exif-thumbnail-adder/issues.

For more information, some known facts and how you may contribute, refer to the project homepage.

Rationale

On some smartphones, when wanting to import pictures to Windows (or any device/operating system supporting MTP or PTP protocols), I noticed the pictures may not display a thumbnail in the import wizard (whether through the Photos app, or through the Windows Explorer import feature).

There are two possible reasons for that behaviour. First, the thumbnail is not present in the picture, usually because the app that created the picture didn't add a thumbnail. Second, there is a thumbnail but it is ignored because some EXIF tags are missing.

Features

Requested permissions

Privacy notice

Installation

License

GPL-3.0 (see "COPYING" file on project homepage)

Contribute

Known facts

Android-Exif-Extended

Exiv2

libexif

pixymeta-android

Concerning some permissions

WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE or READ_MEDIA_IMAGES

MANAGE_EXTERNAL_STORAGE

Since the app uses targetSdk >= 30 (ie Android 11+), I needed to use the MANAGE_EXTERNAL_STORAGE permission.

Some explanations:

The app uses the Storage Access Framework to process the files. However, with Storage Access Framework, on copying files or modifying them, timestamps get updated. But when adding thumbnails we don't want them to change and thus I set them back to the original value. To set the values of timestamps back I use the BasicFileAttributesView class 1. This works fine until targetSdk 28 (=android 9). There is a workaround for targetSdk 29 (android 10) but from targetSdk 30 (Android 11) onwards, the method returns an "AccessDeniedException". So I ended up using MANAGE_EXTERNAL_STORAGE with targetSdk >= 30, see 2.

So in the App, when one is on Android 11+ with targetSdk >= 30, one is invited to give the "all files access" permissions through the settings. This is not mandatory. In case permission is not given, the user is informed that timestamps can't be kept during processing.

Please note that this is about the timestamps of the files (not the ones in the EXIF tags)

ACCESS_MEDIA_LOCATION

POST_NOTIFICATIONS

Development / Building from source

This project has been developed in "Android Studio", you may use that to build the app yourself.

Version 1.0.0 was made with Android Studio Dolphin (2023.2).

In addition to Android Studio you need these SDK components which will be installed by Android Studio's SDK Manager:

Flavors

The app can be compiled in any of the following flavors:

To create screenshots

With screengrab 2.1.1 you must run them on API <= 30. See screengrab bugreport.

From within the root directory of the project run:

ANDROID_SDK_ROOT=~/Android/Sdk/ bundle exec fastlane screenshots
ANDROID_SDK_ROOT=~/Android/Sdk/ bundle exec fastlane screenshots_sevenInch

To run the tests

  1. Get the test pictures:

    cd tests/data/exif-samples
    git clone https://github.com/ianare/exif-samples
    
  2. run the test suite

    ANDROID_SDK_ROOT=~/Android/Sdk/ bundle exec fastlane connectedCheck_with_screenrecord
    
  3. run the test scripts

    cd tests
    ./run_tests.sh