From a technical point of view under analysis Why do not send “artwork” on the Internet

Now any smartphone photo shoot, there is a thing called EXIF ​​parameters, which includes a variety of image data aperture, shutter speed, ISO, white balance, date, time, location, etc., today we use the code to demonstrate under a picture What unexpected data can be obtained.

Article directory

First, what is the EXIF ​​information? Second, reading the image information is introduced jar package 1. 2. 3. Run the code read image and print image information 4. Analysis

First, what is the EXIF ​​information?

EXIF (Exchangeable Image File format) is the “Exchangeable Image File” abbreviation, which contains specifically for digital camera photos and custom metadata, shooting parameters can record digital photos, thumbnails, and other attribute information.

EXIF metadata recorded information is very rich, mainly contains the following information:

    Recording Date

    Shooting equipment (body, lens, flash, etc.)

    Capturing parameters (shutter speed, aperture F value, ISO speed, focal length, metering mode)

    The image processing parameters (sharpening, contrast, saturation, white balance, etc.)

    Image description and copyright information

    GPS location data


Second, read the image information

First put a few days ago, took the picture, as shown below:

Pictures to be analyzed

1. Introducing a jar package


2. Read Picture Code

/ ** * * @Author: Java annoying chatters * * /

public void readPic() {

"Start reading Image ..."

    File jpegFile = new File("g:\\123.jpg");
    Metadata metadata;
    try {
        metadata = JpegMetadataReader.readMetadata(jpegFile);
        Iterator it = metadata.getDirectories().iterator();
        while (it.hasNext()) {
            Directory exif =;
            Iterator tags = exif.getTags().iterator();
            while (tags.hasNext()) {
                Tag tag = (Tag);

"Image reading is completed!"

    } catch (JpegProcessingException e) {
    } catch (IOException e) {

3. Run and Print Image

[JPEG] Compression Type - Baseline
[JPEG] Data Precision - 8 bits
[JPEG] Image Height - 3968 pixels
[JPEG] Image Width - 2976 pixels
[JPEG] Number of Components - 3
[JPEG] Component 1 - Y component: Quantization table 0, Sampling factors 2 horiz/2 vert
[JPEG] Component 2 - Cb component: Quantization table 1, Sampling factors 1 horiz/1 vert
[JPEG] Component 3 - Cr component: Quantization table 1, Sampling factors 1 horiz/1 vert
[JFIF] Version - 1.1
[JFIF] Resolution Units - inch
[JFIF] X Resolution - 96 dots
[JFIF] Y Resolution - 96 dots
[JFIF] Thumbnail Width Pixels - 0
[JFIF] Thumbnail Height Pixels - 0
[Exif IFD0] Image Width - 2976 pixels
[Exif IFD0] Image Height - 3968 pixels
[Exif IFD0] Bits Per Sample - 8 8 8 bits/component/pixel
[Exif IFD0] Make - HUAWEI
[Exif IFD0] Model - STF-AL10
[Exif IFD0] Orientation - Unknown (0)
[Exif IFD0] X Resolution - 72 dots per inch
[Exif IFD0] Y Resolution - 72 dots per inch
[Exif IFD0] Resolution Unit - Inch
[Exif IFD0] Software - STF-AL10
[Exif IFD0] Date/Time - 2019:08:31 10:21:10
[Exif IFD0] YCbCr Positioning - Center of pixel array
[Exif IFD0] Device Setting Description - 105 112 112 0
[Exif SubIFD] Document Name - 
[Exif SubIFD] Exposure Time - 269/500000 sec
[Exif SubIFD] F-Number - f/2.2
[Exif SubIFD] Exposure Program - Program normal
[Exif SubIFD] ISO Speed Ratings - 50
[Exif SubIFD] Exif Version - 2.10
[Exif SubIFD] Date/Time Original - 2019:08:31 10:21:10
[Exif SubIFD] Date/Time Digitized - 2019:08:31 10:21:10
[Exif SubIFD] Components Configuration - YCbCr
[Exif SubIFD] Compressed Bits Per Pixel - 0.95 bits/pixel
[Exif SubIFD] Shutter Speed Value - 1/999963864 sec
[Exif SubIFD] Aperture Value - f/2.2
[Exif SubIFD] Brightness Value - 0.0
[Exif SubIFD] Exposure Bias Value - 0 EV
[Exif SubIFD] Max Aperture Value - f/2.2
[Exif SubIFD] Metering Mode - Multi-segment
[Exif SubIFD] White Balance - Daylight
[Exif SubIFD] Flash - Flash did not fire
[Exif SubIFD] Focal Length - 4 mm
[Exif SubIFD] Makernote - 35 35 42 42 115 100 114 0
[Exif SubIFD] Sub-Sec Time - 579428
[Exif SubIFD] Sub-Sec Time Original - 579428
[Exif SubIFD] Sub-Sec Time Digitized - 579428
[Exif SubIFD] FlashPix Version - 1.00
[Exif SubIFD] Color Space - sRGB
[Exif SubIFD] Exif Image Width - 2976 pixels
[Exif SubIFD] Exif Image Height - 3968 pixels
[Exif SubIFD] Sensing Method - One-chip color area sensor
[Exif SubIFD] File Source - 

Digital Still Camera (DSC) [Exif SubIFD] Scene Type - Directly photographed image [Exif SubIFD] Custom Rendered - Custom process [Exif SubIFD] Exposure Mode - Auto exposure [Exif SubIFD] White Balance Mode - Auto white balance [Exif SubIFD] Digital Zoom Ratio - 1 [Exif SubIFD] Focal Length 35 - 27 mm [Exif SubIFD] Scene Capture Type - Standard [Exif SubIFD] Gain Control - None [Exif SubIFD] Contrast - None [Exif SubIFD] Saturation - None [Exif SubIFD] Sharpness - None [Exif SubIFD] Subject Distance Range - Unknown [Interoperability] Interoperability Index - Recommended Exif Interoperability Rules (ExifR98) [Interoperability] Interoperability Version - 1.00 [GPS] GPS Version ID - 2.200 [GPS] GPS Latitude Ref - N [GPS] GPS Latitude - 40 ° 0 '27.18 "[GPS] GPS Longitude Ref - E [GPS] GPS Longitude - 116 ° 23' 8.97" [GPS] GPS Altitude Ref - Below sea level [GPS] GPS Altitude - 0 metres [GPS] GPS Time-Stamp - 02: 21: 09.000 UTC [GPS] GPS Processing Method - CELLID [GPS] GPS Date Stamp - 2019: 08: 31 [Exif Thumbnail] Image Width - 384 pixels [Exif Thumbnail] Image Height - 512 pixels [ exif Thumbnail] Compression - JPEG (old-style) [exif Thumbnail] Orientation - Unknown (0) [exif Thumbnail] X Resolution - 72 dots per inch [exif Thumbnail] Y Resolution - 72 dots per inch [exif Thumbnail] Resolution Unit - Inch [Exif Thumbnail] Thumbnail Offset - 8888 bytes [Exif Thumbnail] Thumbnail Length - 26905 bytes [Huffman] Number of Tables - 4 Huffman tables [File] File Name - 123.jpg [File] File Size - 2959902 bytes image information reading carry out!

4. Analysis

Log information print more of the above, I screened several important picture information is as follows:

[Exif IFD0] Make - HUAWEI
[Exif IFD0] Model - STF-AL10
[Exif IFD0] Software - STF-AL10
[Exif IFD0] Date/Time - 2019:08:31 10:21:10
[GPS] GPS Version ID - 2.200
[GPS] GPS Latitude Ref - N
[GPS] GPS Latitude - 40° 0' 27.18"
[GPS] GPS Longitude Ref - E
[GPS] GPS Longitude - 116° 23' 8.97"

Several important log above, we can see the specific camera equipment, time and latitude and longitude information. With the longitude and latitude, we continue to analyze, open the URL, enter the above latitude and longitude information, let’s see what happens, shots are as follows:

See this location shots, I just want to say, really accurate positioning, this is just a picture, if more than a few photos showing a person will be able to complete the trail, if the information is determined to take advantage of the people, the consequences difficult imagination.

A picture is not just a simple picture, there are a lot of additional information, so we made artwork must be careful in public.

Recommended Reading

1.Redis bulk delete key tips, you know? 2.Spring Boot 2.X how to quickly integrate jpa? 3.Spring Boot of Profile– quickly get multi-use environment with integrated switch 4.Spring Boot 2.X Spring-cache, make your website speed fly 5. Use Spring Boot + WxJava achieve integrated micro believe the site login feature

Limited Time receive a free Java-related information, covering Java, Redis, MongoDB, MySQL, Zookeeper, Spring Cloud, Dubbo / Kafka, Hadoop, Hbase, Flink high concurrent distributed, big data and machine learning techniques. Watch below the number to receive a free public:

Java annoying chatters public No.


Leave a Reply