What is Image GPS data?
Global Positioning System (GPS) data is the latitude and longitude coordinates that can be linked to the image. It is a part of an image’s metadata and usually, it is used to record where the picture was taken/created. Most phones nowadays automatically attach the GPS data to the images you take.
Where can I find it?
It is a part of the EXIF data, which is the metadata of an image. It can be found in the following image formats HEIC, JPEG, PNG, TIFF, WEBP. You can easily view the metadata in an image, you most likely have found it before when clicking to look for more information when viewing an image. In our JDeli Viewer, you can easily find it here.
How can I extract Imaage GPS data in Java?
There are many ways you can extract this data from the image in Java. You can use ImageIO, Apache Tika or our JDeli library.
They all give an easy and simple way to extract the metadata in just one or a few lines of code.
final ImageDetector detector = new ImageDetector();
ImageReader imageReader = ImageIO.getImageReadersByFormatName("ImageFormat").next();
imageReader.setInput(ImageIO.createImageInputStream(new ByteArrayInputStream(byte data)), true);
IIOMetadata metadata = imageReader.getImageMetadata(0);
You can find out more about handling metadata with our JDeli Image Library over on our support site.
Are you a Developer working with PDF files?
Our developers guide contains a large number of technical posts to help you understand the PDF file Format.
Do you need to solve any of these problems?
|Display PDF documents in a Web app|
|Use PDF Forms in a web browser|
|Convert PDF Documents to an image|
|Work with PDF Documents in Java|