Add get image metadata from vipsheader
Opened this issue · 0 comments
leotu commented
- https://www.libvips.org/API/current/libvips-header.html
- https://github.com/libvips/libvips/blob/master/tools/vipsheader.c
vipsheader --help
...
-a, --all show all fields
-f, --field=FIELD print value of FIELD ("getext" reads extension block, "Hist" reads image history)
-v, --version print version
--vips-concurrency=N evaluate with N concurrent threads
--vips-progress show progress feedback
--vips-leak leak-check on exit
--vips-profile profile and dump timing on exit
--vips-disc-threshold=N images larger than N are decompressed to disc
--vips-novector disable vectorised versions of operations
--vips-cache-max=N cache at most N operations
--vips-cache-max-memory=N cache at most N bytes in memory
--vips-cache-max-files=N allow at most N open files
--vips-cache-trace trace operation cache
--vips-cache-dump dump operation cache on exit
--vips-version print libvips version
--vips-config print libvips config
--vips-pipe-read-limit read at most this many bytes from a pipe
- Sample:
vipsheader -a ~/Downloads/apple_iphone_12_pro_02.jpg
- Output:
...
~/Downloads/apple_iphone_12_pro_02.jpg: 4032x3024 uchar, 3 bands, srgb, jpegload
width: 4032
height: 3024
bands: 3
format: uchar
coding: none
interpretation: srgb
xoffset: 0
yoffset: 0
xres: 2.83465
yres: 2.83465
filename: ~/Downloads/apple_iphone_12_pro_02.jpg
vips-loader: jpegload
jpeg-multiscan: 0
jpeg-chroma-subsample: 4:2:0
exif-data: 13152 bytes of binary data
resolution-unit: in
exif-ifd0-Make: Apple (Apple, ASCII, 6 components, 6 bytes)
exif-ifd0-Model: iPhone 12 Pro (iPhone 12 Pro, ASCII, 14 components, 14 bytes)
exif-ifd0-Orientation: 1 (Top-left, Short, 1 components, 2 bytes)
exif-ifd0-XResolution: 72/1 (72, Rational, 1 components, 8 bytes)
exif-ifd0-YResolution: 72/1 (72, Rational, 1 components, 8 bytes)
exif-ifd0-ResolutionUnit: 2 (Inch, Short, 1 components, 2 bytes)
exif-ifd0-Software: 14.1 (14.1, ASCII, 5 components, 5 bytes)
exif-ifd0-DateTime: 2020:10:24 23:38:42 (2020:10:24 23:38:42, ASCII, 20 components, 20 bytes)
exif-ifd0-YCbCrPositioning: 1 (Centered, Short, 1 components, 2 bytes)
exif-ifd1-Compression: 6 (JPEG compression, Short, 1 components, 2 bytes)
exif-ifd1-XResolution: 72/1 (72, Rational, 1 components, 8 bytes)
exif-ifd1-YResolution: 72/1 (72, Rational, 1 components, 8 bytes)
exif-ifd1-ResolutionUnit: 2 (Inch, Short, 1 components, 2 bytes)
exif-ifd2-ExposureTime: 1/30 (1/30 sec., Rational, 1 components, 8 bytes)
exif-ifd2-FNumber: 8/5 (f/1.6, Rational, 1 components, 8 bytes)
exif-ifd2-ExposureProgram: 2 (Normal program, Short, 1 components, 2 bytes)
exif-ifd2-ISOSpeedRatings: 640 (640, Short, 1 components, 2 bytes)
exif-ifd2-ExifVersion: Exif Version 2.31 (Exif Version 2.31, Undefined, 4 components, 4 bytes)
exif-ifd2-DateTimeOriginal: 2020:10:24 23:38:42 (2020:10:24 23:38:42, ASCII, 20 components, 20 bytes)
exif-ifd2-DateTimeDigitized: 2020:10:24 23:38:42 (2020:10:24 23:38:42, ASCII, 20 components, 20 bytes)
exif-ifd2-OffsetTime: +01:00 (+01:00, ASCII, 7 components, 7 bytes)
exif-ifd2-OffsetTimeOriginal: +01:00 (+01:00, ASCII, 7 components, 7 bytes)
exif-ifd2-OffsetTimeDigitized: +01:00 (+01:00, ASCII, 7 components, 7 bytes)
exif-ifd2-ComponentsConfiguration: Y Cb Cr - (Y Cb Cr -, Undefined, 4 components, 4 bytes)
exif-ifd2-ShutterSpeedValue: 33952/6913 (4.91 EV (1/30 sec.), SRational, 1 components, 8 bytes)
exif-ifd2-ApertureValue: 14447/10653 (1.36 EV (f/1.6), Rational, 1 components, 8 bytes)
exif-ifd2-BrightnessValue: -31051/22176 (-1.40 EV (1.30 cd/m^2), SRational, 1 components, 8 bytes)
exif-ifd2-ExposureBiasValue: 0/1 (0.00 EV, SRational, 1 components, 8 bytes)
exif-ifd2-MeteringMode: 5 (Pattern, Short, 1 components, 2 bytes)
exif-ifd2-Flash: 16 (Flash did not fire, compulsory flash mode, Short, 1 components, 2 bytes)
exif-ifd2-FocalLength: 21/5 (4.2 mm, Rational, 1 components, 8 bytes)
exif-ifd2-SubjectArea: 2002 1506 2213 1327 (Within rectangle (width 2213, height 1327) around (x,y) = (2002,1506), Short, 4 components, 8 bytes)
exif-ifd2-MakerNote: 1354 bytes undefined data (1354 bytes undefined data, Undefined, 1354 components, 1354 bytes)
exif-ifd2-SubSecTimeOriginal: 303 (303, ASCII, 4 components, 4 bytes)
exif-ifd2-SubSecTimeDigitized: 303 (303, ASCII, 4 components, 4 bytes)
exif-ifd2-FlashpixVersion: FlashPix Version 1.0 (FlashPix Version 1.0, Undefined, 4 components, 4 bytes)
exif-ifd2-ColorSpace: 65535 (Uncalibrated, Short, 1 components, 2 bytes)
exif-ifd2-PixelXDimension: 4032 (4032, Long, 1 components, 4 bytes)
exif-ifd2-PixelYDimension: 3024 (3024, Long, 1 components, 4 bytes)
exif-ifd2-SensingMethod: 2 (One-chip color area sensor, Short, 1 components, 2 bytes)
exif-ifd2-SceneType: Directly photographed (Directly photographed, Undefined, 1 components, 1 bytes)
exif-ifd2-ExposureMode: 0 (Auto exposure, Short, 1 components, 2 bytes)
exif-ifd2-WhiteBalance: 0 (Auto white balance, Short, 1 components, 2 bytes)
exif-ifd2-FocalLengthIn35mmFilm: 26 (26, Short, 1 components, 2 bytes)
exif-ifd2-SceneCaptureType: 0 (Standard, Short, 1 components, 2 bytes)
exif-ifd2-LensSpecification: 807365/524263 6/1 8/5 12/5 (1.540000, 6, 1.6, 2.4, Rational, 4 components, 32 bytes)
exif-ifd2-LensMake: Apple (Apple, ASCII, 6 components, 6 bytes)
exif-ifd2-LensModel: iPhone 12 Pro back triple camera 4.2mm f/1.6 (iPhone 12 Pro back triple camera 4.2mm f/1.6, ASCII, 45 components, 45 bytes)
exif-ifd2-CompositeImage: 2 (2, Short, 1 components, 2 bytes)
exif-ifd3-GPSLatitudeRef: N (N, ASCII, 2 components, 2 bytes)
exif-ifd3-GPSLatitude: 51/1 28743166/1000000 0/1 (51, 28.743166, 0, Rational, 3 components, 24 bytes)
exif-ifd3-GPSLongitudeRef: W (W, ASCII, 2 components, 2 bytes)
exif-ifd3-GPSLongitude: 3/1 10709833/1000000 0/1 ( 3, 10.709833, 0, Rational, 3 components, 24 bytes)
exif-ifd3-GPSAltitudeRef: Sea level (Sea level, Byte, 1 components, 1 bytes)
exif-ifd3-GPSAltitude: 162439/8673 (18.7293, Rational, 1 components, 8 bytes)
exif-ifd3-GPSSpeedRef: K (K, ASCII, 2 components, 2 bytes)
exif-ifd3-GPSSpeed: 0/1 ( 0, Rational, 1 components, 8 bytes)
exif-ifd3-GPSImgDirectionRef: T (T, ASCII, 2 components, 2 bytes)
exif-ifd3-GPSImgDirection: 351364/2169 (161.9935, Rational, 1 components, 8 bytes)
exif-ifd3-GPSDestBearingRef: T (T, ASCII, 2 components, 2 bytes)
exif-ifd3-GPSDestBearing: 351364/2169 (161.9935, Rational, 1 components, 8 bytes)
exif-ifd3-GPSHPositioningError: 108502/30689 (3.53553, Rational, 1 components, 8 bytes)
jpeg-thumbnail-data: 10587 bytes of binary data
orientation: 1
xmp-data: 3667 bytes of binary data
iptc-data: 98 bytes of binary data
icc-profile-data: 548 bytes of binary data
...