Search in sources :

Example 1 with ExifInterfaceWrapper

use of com.aviary.android.feather.library.media.ExifInterfaceWrapper in project mobile-android by photo.

the class FeatherActivity method saveExif.

protected void saveExif(String path) {
    logger.log("saveExif: " + path);
    if (null == path) {
        return;
    }
    LocalDataService data = mFilterManager.getService(LocalDataService.class);
    ExifInterfaceWrapper newexif = null;
    if (null != data) {
        try {
            newexif = new ExifInterfaceWrapper(path);
        } catch (IOException e) {
            logger.error(e.getMessage());
            e.printStackTrace();
            return;
        }
        ;
        Bundle bundle = data.getOriginalExifBundle();
        if (null != bundle) {
            try {
                newexif.copyFrom(bundle);
                newexif.setAttribute(ExifInterfaceWrapper.TAG_ORIENTATION, "0");
                newexif.setAttribute(ExifInterfaceWrapper.TAG_SOFTWARE, "Aviary for Android " + SDK_VERSION);
                // implements this to include your own tags
                onSaveCustomTags(newexif);
                newexif.saveAttributes();
            } catch (Throwable t) {
                t.printStackTrace();
                logger.error(t.getMessage());
            }
        }
    }
}
Also used : LocalDataService(com.aviary.android.feather.library.services.LocalDataService) Bundle(android.os.Bundle) ExifInterfaceWrapper(com.aviary.android.feather.library.media.ExifInterfaceWrapper) IOException(java.io.IOException)

Example 2 with ExifInterfaceWrapper

use of com.aviary.android.feather.library.media.ExifInterfaceWrapper in project mobile-android by photo.

the class ExifTask method call.

@Override
public Bundle call(EffectContext context, String path) {
    if (path == null) {
        return null;
    }
    Bundle result = new Bundle();
    try {
        ExifInterfaceWrapper exif = new ExifInterfaceWrapper(path);
        exif.copyTo(result);
    } catch (Throwable t) {
        t.printStackTrace();
    }
    return result;
}
Also used : Bundle(android.os.Bundle) ExifInterfaceWrapper(com.aviary.android.feather.library.media.ExifInterfaceWrapper)

Aggregations

Bundle (android.os.Bundle)2 ExifInterfaceWrapper (com.aviary.android.feather.library.media.ExifInterfaceWrapper)2 LocalDataService (com.aviary.android.feather.library.services.LocalDataService)1 IOException (java.io.IOException)1