Rename camera images from exif data using tasker
Use Tasker's native Java calls

Java code

Use ExifInterface.getAttribute to solve this problem.

exif = new ExifInterface( %filename )
%datetime = exif.getAttribute(exif.TAG_DATETIME)


Implementation overview


Getting path of a .JPG from %filename Tasker variable
Construct a new ExifInterface class instance into exif Java variable
Get date &amp; time by exif.getAttribute Java function, and store results into %datetime Tasker variable
Free exif Java variable
Check %datetime is set (this is not set when .JPG is not contains EXIF info)




Step by step solution in Tasker


Add a new Code > Java Function action

a. Set ExifInterface to Class Or Object (or select by magnifying glass button)

b. Write new \\ {ExifInterface} (String) to Function (or select by magnifying glass button)

c. Write %filename to Param (String)

d. Write exif to Return {ExifInterface}


Add a new Code > Java Function action

a. Write exif to Class Or Object (or select by coffee button)

b. Write getAttribute \\ {String} (String) to Function (or select by magnifying glass button)

c. Write exif.TAG_DATETIME to Param (String)

d. Write %datetime to Return {String}


Add a new Code > Java Object action

a. Left Mode on Delete

b. and write exif to Name


Check %datetime is set - I added a conditional Flash for show %datetime


Done!