Hi,
I want to know how to get metadata of an image (like geolocation containing latitude and longitude). Is there a way to get it at all?
Discussion posts and replies are publicly visible
AFAIK, there isn't a way to do that unless you send the image outside Appian via an integration to get these details.
As Harshit mentioned, there is no possibility to get the metadata direct from the photo.But what you can get is the geolocation of the task with which the photo was uploaded. https://docs.appian.com/suite/help/23.1/Configuring_the_User_Input_Task.html#capturing-task-submission-location
So this can be utilized as a work around: Assigning a task where the user has to upload a photo taken with his camera on the spot.The geolocation will be available as an attribute in the task.
Maybe that helps.
It'd probably be... not *too* difficult, maybe, for someone to write a custom plug-in to do this analysis on relevant files - but that would be its own whole new thing, someone would need to be used to coding plugins (and have a setup that allows for it), etc.
How about using chatGPT for it? Generated this code from it. Not sure how much of it is correct
import com.appiancorp.plugins.sdk.PluginContext; import com.appiancorp.plugins.sdk.ui.EmbeddedBrowser; import com.appiancorp.plugins.sdk.ui.TextValueComponent; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class GeoLocationPlugin { public static void extractGeoLocation(PluginContext context, String filePath) { try { File imageFile = new File(filePath); BufferedImage image = ImageIO.read(imageFile); double latitude = extractLatitude(image); double longitude = extractLongitude(image); String location = String.format("%f,%f", latitude, longitude); TextValueComponent locationComponent = context.createTextValueComponent(location); EmbeddedBrowser browser = context.createEmbeddedBrowser(locationComponent); browser.setWidth(400); browser.setHeight(300); browser.setUrl(String.format("https://www.google.com/maps?q=%s", location)); context.publishValue(locationComponent); } catch (IOException e) { context.logError("Failed to extract geo location from image", e); } } private static double extractLatitude(BufferedImage image) { // TODO: Implement the logic to extract the latitude from the image. // This may involve reading the EXIF metadata of the image, if available. return 0.0; } private static double extractLongitude(BufferedImage image) { // TODO: Implement the logic to extract the longitude from the image. // This may involve reading the EXIF metadata of the image, if available. return 0.0; } }
When the option Capture location on submission (only supported in Appian Mobile) is enabled, Submission Location result data is available in the Outputs section of the Data tab. Submission Location has the following fields:
Submission Location
true
false
More Details here
From a first glance it looks like it may have just generated you a placeholder...
Captured geolocation of a task submission doesn't seem to be what the original poster was asking about.
Using metadata-extractor libraries, a plugin can be developed in java which returns the metadata information.
exactly. I was asking about the geolocation of the image where it was taken.
Unknown said:a plugin can be developed
Turns out there is such a plug-in now. It eluded my various search attempts until just now, weirdly.
community.appian.com/.../get-file-metadata