This is a wrap for the Android Support ExifInterface announced here
ExifInterface4a
Author: DonManfred (wrapper)
Version: 1.3
ExifInterface
Fields:
Basic usage
ExifInterface4a
Author: DonManfred (wrapper)
Version: 1.3
ExifInterface
Fields:
- exifAttributesAPI9 As java.lang.String[]
- exifAttributesAPI11 As java.lang.String[]
- exifOrientationConstants As int[]
- exifAttributesAPI23 As java.lang.String[]
- exifAttributesAPI24 As java.lang.String[]
- hasThumbnail As boolean
- getAltitude (defaultValue As double) As double
- IsInitialized As boolean
- isThumbnailCompressed As boolean
- Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String, filePath As java.lang.String) As void
- setAttribute (tag As java.lang.String, value As java.lang.String) As void
- getAttribute (attribute As java.lang.String) As java.lang.String
- getAttributeInt (attribute As java.lang.String, defaultValue As int) As int
- GetAllAttributes As anywheresoftware.b4a.objects.collections.Map
Will return the exifdata as read in initialize as a Map - saveAttributes As void
- getAttributeDouble (attribute As java.lang.String, defaultValue As double) As double
- getLatLong (defaultValue As float[]) As boolean
- GetAllAttributes2 As anywheresoftware.b4a.objects.collections.Map
Will return the most-up-to-date exifdata as a Map
- ThumbnailRange As long[] [read only]
- ThumbnailBytes As byte[] [read only]
- GpsDateTime As long [read only]
- ThumbnailBitmap As android.graphics.Bitmap [read only]
- Thumbnail As byte[] [read only]
- DateTime As long [read only]
Basic usage
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim exif As ExifInterface
Private rp As RuntimePermissions
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
If File.Exists(rp.GetSafeDirDefaultExternal("pics"), "hd_roccaabisso.jpg") = False Then
File.Copy(File.DirAssets,"hd_roccaabisso.jpg",rp.GetSafeDirDefaultExternal("pics"), "hd_roccaabisso.jpg")
End If
Dim filePath As String
filePath = File.Combine(rp.GetSafeDirDefaultExternal("pics"), "hd_roccaabisso.jpg")
exif.Initialize("",filePath)
Dim m As Map = exif.GetAllAttributes
'Log(m)
'Log(m.Get("UserComment"))
Dim usercomment As String = m.Get("UserComment")
Log("Length of UserComment read: "&usercomment.Length)
exif.setAttribute("UserComment",usercomment) ' overwrite the Usercomment with new content... here no change as it writes back the UserComment which was in the image...
exif.saveAttributes ' Save all changes back to the image.
End Sub