What information is stored in EFIX/JPEG photos taken on the iPhone with geotagging enabled? - iphone

I know that some of this data is viewable in iPhoto, such as latitude, longitude, and altitude, but is there more than this available? More specifically I am wanting to get the direction of the image as well, which is part of the EXIF format. Or does something other than geotagging need to be enabled (something to do with the compass)?

I suggest installing the command line tool exif. You can get it through Mac Ports by executing port install exif as root.
Here's an example of the exif info stored in a photo I took on an iPod Touch:
bash:$ exif Oct\ 9\,\ 2010/IMG_0038.JPG
EXIF tags in 'Oct 9, 2010/IMG_0018.JPG' ('Motorola' byte order):
--------------------+----------------------------------------------------------
Tag |Value
--------------------+----------------------------------------------------------
Manufacturer |Apple
Model |iPod touch
Orientation |right - top
x-Resolution |72.00
y-Resolution |72.00
Resolution Unit |Inch
Software |4.1
Date and Time |2010:10:06 17:43:43
YCbCr Positioning |centered
Compression |JPEG compression
x-Resolution |72.00
y-Resolution |72.00
Resolution Unit |Inch
Exposure Time |1/120 sec.
FNumber |f/2.4
Exposure Program |Normal program
ISO Speed Ratings |320
Exif Version |Exif Version 2.21
Date and Time (origi|2010:10:06 17:43:43
Date and Time (digit|2010:10:06 17:43:43
Components Configura|Y Cb Cr -
Shutter speed |6.91 EV (1/120 sec.)
Aperture |2.53 EV (f/2.4)
Metering Mode |Average
Flash |No flash function
Focal Length |3.9 mm
FlashPixVersion |FlashPix Version 1.0
Color Space |sRGB
PixelXDimension |640
PixelYDimension |480
Sensing Method |One-chip color area sensor
Exposure Mode |Auto exposure
White Balance |Auto white balance
Scene Capture Type |Standard
Sharpness |Normal
North or South Latit|N
Latitude |44.00, 22.12, 0.00
East or West Longitu|W
Longitude |56.00, 23.98, 0.00
GPS time (atomic clo|17:43:41.60
--------------------+----------------------------------------------------------
EXIF data contains a thumbnail (10215 bytes).
I don't think the iPod Touch has the same capabilities as an iPhone regarding GPS.
It looks like an iPhone will have the data 'GPSImg Direction' as well, which sounds like what you want. I don't think you have to do anything special to enable it, as I haven't found much info on this through searching.

Okay, good news :). The direction is stored in GPS Img Direction. Here's what I was able to get from a photo taken from an iphone (with location services and compass turned on) using the ExifTool mentioned by #rwong.
ExifTool Version Number : 8.34
File Name : photo.JPG
Directory : C:/Documents and Settings/user/My Document
s/Downloads
File Size : 349 kB
File Modification Date/Time : 2010:10:19 14:05:39-06:00
File Permissions : rw-rw-rw-
File Type : JPEG
MIME Type : image/jpeg
JFIF Version : 1.01
Exif Byte Order : Big-endian (Motorola, MM)
Image Description : Back Camera
Make : Apple
Camera Model Name : iPhone
Orientation : Horizontal (normal)
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Software : 4.0.1
Modify Date : 2010:10:19 14:00:52
Y Cb Cr Positioning : Centered
Exposure Time : 1/146
F Number : 2.4
Exposure Program : Program AE
ISO : 80
Exif Version : 0221
Date/Time Original : 2010:10:19 14:00:52
Create Date : 2010:10:19 14:00:52
Shutter Speed Value : 1/146
Aperture Value : 2.4
Metering Mode : Average
Flash : Off, Did not fire
Focal Length : 3.9 mm
Subject Area : 1295 967 699 696
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 1296
Exif Image Height : 968
Sensing Method : One-chip color area
Exposure Mode : Auto
White Balance : Auto
Scene Capture Type : Standard
Sharpness : Hard
GPS Latitude Ref : North
GPS Longitude Ref : West
GPS Time Stamp : 14:00:46.81
GPS Img Direction Ref : True North
GPS Img Direction : 32.52336904
Image Width : 1296
Image Height : 968
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Aperture : 2.4
GPS Latitude : 45 deg 14' 58.20" N
GPS Longitude : 121 deg 39' 4.80" W
GPS Position : 45 deg 14' 58.20" N, 121 deg 39' 4.80" W
Image Size : 1296x968
Shutter Speed : 1/146
Focal Length : 3.9 mm
Light Value : 10.0

you don't need an 'external' tool to view all the EXIF-infos, with the iPhone-app iMetaPhoto you can show all metainfos (EXIF, TIFF, IPTC, GPS, AUXiliary EXIF,...) and (the best of all) you can modify the most of them, esp. you can modify GPS ImgDirection.

Related

I want to search through <dynamic> List in dart

I have a list of products, the list is below:
List<dynamic>products = [
{
"id": 3,
"name": "Apple MacBook Air 13.3-Inch 10th Gen Core i3-1.1GHz, 8GB RAM, 256GB SSD (MWTJ2) Space Gray 2020",
"price": 126000,
"descriptions": "Processor\tIntel Core i3-1000NG4 Processor (4M Cache, 1.10 GHz up to 3.20 GHz)\r\n\r\nMemory\t 8GB 3733MHz LPDDR4X onboard RAM\r\n\r\nStorage\t 256GB SSD\r\nGraphics\tIntel Iris Plus Graphics; **Support for Thunderbolt 3–enabled external graphics processors (eGPUs)\r\n\r\nDisplay\t 13.3-inch (diagonal) Retina LED-backlit display with IPS technology; 2560-by-1600 native resolution at 227 pixels per inch with support for millions of colors\r\n\r\nAdapter\t 30W USB-C Power Adapter; USB-C power port\r\n\r\nBattery\tUp to 10 hours battery back (Video & web browsing up to 05 hours depending on resolution) Built-in 49.9 watt-hours lithium-polymer battery\r\n\r\nOperating System\tmacOS\r\n\r\nNetworking\t 802.11ac Wi-Fi wireless networking; IEEE 802.11a/b/g/n compatible\r\n\r\nTouchpad\t Multi-Touch gestures\r\n\r\nKeyboard\tBacklit Keyboard - US English Retina is equipped with: 78 keys (ANSI specification) or 79 keys (ISO specification), including 12 function keys and 4 direction keys arranged in an \"inverted T\" shape. Ambient light sensor Force touchpad brings precise cursors Control and pressure-sensing functions, support forceful long-press, acceleration function, pressure-sensitive drawing, and multi-touch gestures\r\n\r\nBluetooth\tBluetooth 5.0 wireless technology\r\n\r\nAudio\t Stereo speakers; Wide stereo sound; Support for Dolby Atmos playback; Three-mic array with directional beamforming; 3.5 mm headphone jack\r\n\r\nOptical Drive None\r\n\r\nSoftware\tFinal Cut Pro X; Logic Pro X\r\n\r\nWebCam\t720p FaceTime HD camera\r\n\r\nFingerprint\tYes\r\n\r\nDisplay Touch\tDisplay WithTouch ID sensor\r\n\r\nPorts & Connectors\t2 x Thunderbolt 3 (Supports DisplayPort and Power Delivery); Thunderbolt (up to 40Gb / s); USB 3.1 Gen 2 (up to 10Gb / s; 1 x HDMI; 1 x VGA; 1 x 3.5 mm Headphone Output\r\n\r\nColor\tSpace Gray\r\n\r\nDimensions (W x D x H)\tThickness: 0.41 to 1.61 cm (0.16 to 0.63 inches); Width: 30.41 cm (11.97 inches); Depth: 21.24 cm (8.36 inches)\r\n\r\nWeight\t1.29 kg (2.8 lbs)\r\n\r\nIncluded in the Box\tMacBook Air; 30W USB-C Power Adapter; USB-C Charge Cable (2 m)\r\n\r\nWarranty \t01 year International Limited Warranty (Terms & Condition Apply As Per Apple)",
"image": "/images/macbook_IU3NvNF.jpg",
"created_at": "2022-08-19T17:42:13.118095Z",
"updated_at": "2022-08-19T17:42:13.118095Z",
"stock": true,
"category": 1,
"user": "mosta"
},
{
"id": 2,
"name": "MSI Modern 14 B10MW Core i3 10th Gen 14\" Full HD Laptop",
"price": 50890,
"descriptions": "Processor Intel Core i3 10110U Processor (4MB Cache, 2.1Ghz up to 4.1Ghz)\r\n\r\nDisplay 14.0\" FHD (1920x1080), IPS-Level Display\r\n\r\nMemory 4GB 2666MHz DDR4 RAM, (Suppoorted Up to 16GB)\r\n\r\nStorage 256GB NVMe SSD (Supported Up to 1TB)\r\n\r\nGraphics Intel UHD Graphics\r\n\r\nOperating System Free Dos\r\nBattery 39.3Whr\r\n\r\nAdapter 65W adapter\r\n\r\nInput Devices\r\nKeyboard Backlight Keyboard\r\n\r\nWebCam HD type (30fps#720p)\r\nCard Reader 1x Micro SD\r\n\r\nNetwork & Wireless Connectivity\r\nWi-Fi 802.11 ac Wi-Fi\r\n\r\nBluetooth Bluetooth v5\r\n\r\nPorts, Connectors & Slots\r\nUSB (s) 2x Type-A USB2.0\r\n\r\n1x Type-C USB3.2 Gen2\r\n\r\nHDMI 1x (4K # 30Hz) HDMI\r\n\r\nAudio Jack Combo 1x Mic-in/Headphone-out Combo Jack\r\n\r\nExtra RAM Slot NO\r\n\r\nExtra M.2 Slot NO\r\n\r\nPhysical Specification\r\nDimensions (W x D x H) 319 x 220.2 x 16.9 mm\r\n\r\nWeight 1.3 kg\r\n\r\nColor(s) Carbon Gray\r\n\r\nWarranty\r\nManufacturing Warranty 02 Year",
"image": "/images/msi_sCwzOcI.jpeg",
"created_at": "2022-08-19T17:41:53.358014Z",
"updated_at": "2022-08-19T17:41:53.358014Z",
"stock": true,
"category": 1,
"user": "mosta"
},
{
"id": 1,
"name": "iPhone 13 Pro Max",
"price": 169000,
"descriptions": "First Release\tSeptember 24, 2021\r\n\r\nColors\tGraphite, Gold, Silver, Sierra Blue\r\n\r\nNetwork\t2G, 3G, 4G, 5G\r\n\r\nSIM\tNano / Electronic SIM\r\n\r\nWLAN\t✅ dual-band, Wi-Fi hotspot\r\n\r\nBluetooth\t✅ v5.0, A2DP, LE\r\n\r\nGPS\t✅ A-GPS, GLONASS, GALILEO, BDS, QZSS\r\n\r\nRadio\t✖\r\n\r\nUSB\tLightning, USB 2.0\r\n\r\nOTG\t✅\r\n\r\nUSB Type-C\t✖ (Proprietary reversible connector)\r\n\r\nNFC\t✅\r\n\r\nStyle\tNotch\r\n\r\nMaterial\t Gorilla Glass front & back, stainless steel frame\r\n\r\nWater Resistance\t✅ IP68 dust/water resistant (up to 6m for 30 mins)\r\n\r\nDimensions\t160.8 x 78.1 x 7.7 mmillimeters\r\n\r\nWeight\t240 grams\r\n\r\nSize\t6.7 inches\r\n\r\nResolution\t1284 x 2778 pixels (458 ppi)\r\n\r\nTechnology\tSuper Retina XDR OLED Touchscreen\r\n\r\nProtection\t✅ Scratch-resistant ceramic glass, oleophobic coating\r\n\r\nFeatures\tDolby Vision, HDR10, 1200 nits (max.), 120Hz, true-tone, wide color gamut\r\n\r\nResolution\tQuad 12+12+12 Megapixel + TOF 3D LiDAR scanner\r\n\r\nFeatures\tDual Pixel PDAF, sensor-shift OIS, dual-LED flash, ultrawide, depth, telephoto, 3x optical zoom & more\r\n\r\nVideo Recording\t4K (2160p), Dolby Vision HDR, ProRes, Cinematic mode, stereo sound rec.\r\n\r\nResolution\tDual 12 Megapixel + SL 3D\r\n\r\nFeatures\tF/2.2, HDR, 1/3.6″, depth / biometrics sensor\r\n\r\nVideo Recording\t4K (2160p), gyro-EIS\r\n\r\nType and Capacity\tLithium-ion 4352 mAh (non-removable)\r\n\r\nFast Charging\t✅ 27W Fast Charging (50% in 30 minutes)\r\n\r\nUSB Power Delivery 2.0\r\n\r\nWireless Charging\t✅ Fast Wireless Charging (15W MagSafe, 7.5W Qi magnetic)\r\n\r\nOperating System\tiOS 15\r\n\r\nChipset\tApple A15 Bionic (5 nm)\r\n\r\nRAM\t6 GB\r\n\r\nProcessor\tHexa-core, up to 3.22 GHz\r\n\r\nGPU\tApple GPU (5-core graphics)",
"image": "/images/iPhone13promax_YiZ3ktK.jpg",
"created_at": "2022-08-19T17:41:27.837767Z",
"updated_at": "2022-08-19T17:41:27.837767Z",
"stock": true,
"category": 2,
"user": "mosta"
}
]
I want to search through the above list by product name. And also want a make separate list contain one single map.
If i search "apple" the result should be:
List<dynamic> searchResult = [
{
"id": 3,
"name": "Apple MacBook Air 13.3-Inch 10th Gen Core i3-1.1GHz, 8GB RAM, 256GB SSD (MWTJ2) Space Gray 2020",
"price": 126000,
"descriptions": "Processor\tIntel Core i3-1000NG4 Processor (4M Cache, 1.10 GHz up to 3.20 GHz)\r\n\r\nMemory\t 8GB 3733MHz LPDDR4X onboard RAM\r\n\r\nStorage\t 256GB SSD\r\nGraphics\tIntel Iris Plus Graphics; **Support for Thunderbolt 3–enabled external graphics processors (eGPUs)\r\n\r\nDisplay\t 13.3-inch (diagonal) Retina LED-backlit display with IPS technology; 2560-by-1600 native resolution at 227 pixels per inch with support for millions of colors\r\n\r\nAdapter\t 30W USB-C Power Adapter; USB-C power port\r\n\r\nBattery\tUp to 10 hours battery back (Video & web browsing up to 05 hours depending on resolution) Built-in 49.9 watt-hours lithium-polymer battery\r\n\r\nOperating System\tmacOS\r\n\r\nNetworking\t 802.11ac Wi-Fi wireless networking; IEEE 802.11a/b/g/n compatible\r\n\r\nTouchpad\t Multi-Touch gestures\r\n\r\nKeyboard\tBacklit Keyboard - US English Retina is equipped with: 78 keys (ANSI specification) or 79 keys (ISO specification), including 12 function keys and 4 direction keys arranged in an \"inverted T\" shape. Ambient light sensor Force touchpad brings precise cursors Control and pressure-sensing functions, support forceful long-press, acceleration function, pressure-sensitive drawing, and multi-touch gestures\r\n\r\nBluetooth\tBluetooth 5.0 wireless technology\r\n\r\nAudio\t Stereo speakers; Wide stereo sound; Support for Dolby Atmos playback; Three-mic array with directional beamforming; 3.5 mm headphone jack\r\n\r\nOptical Drive None\r\n\r\nSoftware\tFinal Cut Pro X; Logic Pro X\r\n\r\nWebCam\t720p FaceTime HD camera\r\n\r\nFingerprint\tYes\r\n\r\nDisplay Touch\tDisplay WithTouch ID sensor\r\n\r\nPorts & Connectors\t2 x Thunderbolt 3 (Supports DisplayPort and Power Delivery); Thunderbolt (up to 40Gb / s); USB 3.1 Gen 2 (up to 10Gb / s; 1 x HDMI; 1 x VGA; 1 x 3.5 mm Headphone Output\r\n\r\nColor\tSpace Gray\r\n\r\nDimensions (W x D x H)\tThickness: 0.41 to 1.61 cm (0.16 to 0.63 inches); Width: 30.41 cm (11.97 inches); Depth: 21.24 cm (8.36 inches)\r\n\r\nWeight\t1.29 kg (2.8 lbs)\r\n\r\nIncluded in the Box\tMacBook Air; 30W USB-C Power Adapter; USB-C Charge Cable (2 m)\r\n\r\nWarranty \t01 year International Limited Warranty (Terms & Condition Apply As Per Apple)",
"image": "/images/macbook_IU3NvNF.jpg",
"created_at": "2022-08-19T17:42:13.118095Z",
"updated_at": "2022-08-19T17:42:13.118095Z",
"stock": true,
"category": 1,
"user": "mosta"
}]
How to approach to make this step?
import 'package:collection/collection.dart';
and use firstWhereOrNull;
example:
searchArray(String searchValue){
var test =
products.firstWhereOrNull((element) => element['name'].contains(searchValue));
print(test); //print just first object whos name property contains "MSI"
}
Or
searchArray(String searchValue) {
var test =
products.where((element) => element['name'].toString().contains(searchValue));
if (test != null) {
for (var testItem in test) {
print(testItem); //print all maps whos contains sV
}
}
}
Here is one of approach you can use to search some query through the list and add the result in another list using for in iterables
void search(String query) {
List<dynamic> searchResult = [];
for (final product in products) {
if (product["name"].toLowerCase().contains(query.toLowerCase())) {
searchResult.add(product);
print(searchResult);
return;
}
}
}
full code here
Or you can use firstWhereOrNull in dart collection as mentioned by Kendruu

How Can I Change Mime Type In the Metadata on File

I want to change the "MIME Type" in the file:
└──╼ $exiftool realshort.mp4
ExifTool Version Number : 12.10
File Name : realshort.mp4
Directory : .
File Size : 98 kB
File Modification Date/Time : 2021:01:19 23:53:01+00:00
File Access Date/Time : 2021:01:19 23:53:01+00:00
File Inode Change Date/Time : 2021:01:19 23:53:01+00:00
File Permissions : rw-r--r--
File Type : MP4
File Type Extension : mp4
MIME Type : video/mp4
Major Brand : MP4 Base Media v1 [IS0 14496-12:2003]
Minor Version : 0.0.0
Compatible Brands : isom, 3gp4
Movie Header Version : 0
Create Date : 2014:11:05 13:51:33
Modify Date : 2014:11:05 13:51:33
Time Scale : 1000
Duration : 1.20 s
Preferred Rate : 1
Preferred Volume : 100.00%
Preview Time : 0 s
Preview Duration : 0 s
Poster Time : 0 s
Selection Time : 0 s
Selection Duration : 0 s
Current Time : 0 s
Next Track ID : 3
Track Header Version : 0
Track Create Date : 2014:11:05 13:51:33
Track Modify Date : 2014:11:05 13:51:33
Track ID : 1
Track Duration : 1.20 s
Track Layer : 0
Track Volume : 0.00%
Image Width : 320
Image Height : 240
Graphics Mode : srcCopy
Op Color : 0 0 0
Compressor ID : avc1
Source Image Width : 320
Source Image Height : 240
X Resolution : 72
Y Resolution : 72
Compressor Name :
Bit Depth : 24
Video Frame Rate : 30.02
Matrix Structure : 1 0 0 0 1 0 0 0 1
Media Header Version : 0
Media Create Date : 2014:11:05 13:51:33
Media Modify Date : 2014:11:05 13:51:33
Media Time Scale : 48000
Media Duration : 1.17 s
Handler Type : Audio Track
Handler Description : SoundHandle
Balance : 0
Audio Format : mp4a
Audio Channels : 1
Audio Bits Per Sample : 16
Audio Sample Rate : 48000
XMP Toolkit : Image::ExifTool 12.10
Media Data Size : 95268
Media Data Offset : 4610
Image Size : 320x240
Megapixels : 0.077
Avg Bitrate : 636 kbps
Rotation : 0
If I do:
exiftool -artist=ii realshort.mp4
i can add artist tag with the value ii
But if I do: exiftool -"mime type"=ii realshort.mp4 it won't work
I looked at: https://libre-software.net/edit-metadata-exiftool/
And also here: How do you change the MIME type of a file from the terminal?
But I can't find any answer
How can I make it work?
You can't change the MIME type. It's not embedded data. It's a tag derived from what the type of file is.
You could edit try editing the .Exiftool_Config file if you have one (see the example config) to override the base definition, but that will only change what exiftool displays. Another program or another computer will output MP4 as the MIME type.

Tiling floating point raster for use with leaflet.tilelayer.glcolorscale

I want to use the leaflet.tilelayer.glcolorscale plugin. I have a float32 geotiff raster with values ranging from 0 to ~ 66. Reading the documentation on github, it appears that they are tiling using non-standard method. I'm familiar with taking a RGBA raster and using gdal2tile.py to create a png tileset.
How do I tile this float32 geotiff for use with this plugin?
I've provided the gdalinfo on my source geotiff below. I tried using gdal2tile.py to tile, with poor results. Thanks.
>gdalinfo spat_model.tif
Driver: GTiff/GeoTIFF
Files: spat_model.tif
Size is 8618, 6783
Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["X",EAST],
AXIS["Y",NORTH],
EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=#null +wktext +no_defs"],
AUTHORITY["EPSG","3857"]]
Origin = (-12148437.776279186829925,6306111.101677093654871)
Pixel Size = (44.801481702694637,-44.801481702694637)
Metadata:
AREA_OR_POINT=Area
DataType=Generic
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left (-12148437.776, 6306111.102) (109d 7'52.58"W, 49d11' 1.78"N)
Lower Left (-12148437.776, 6002222.651) (109d 7'52.58"W, 47d22' 2.03"N)
Upper Right (-11762338.607, 6306111.102) (105d39'46.39"W, 49d11' 1.78"N)
Lower Right (-11762338.607, 6002222.651) (105d39'46.39"W, 47d22' 2.03"N)
Center (-11955388.192, 6154166.876) (107d23'49.49"W, 48d17' 0.98"N)
Band 1 Block=8618x1 Type=Float32, ColorInterp=Gray
NoData Value=-1
Metadata:
RepresentationType=ATHEMATIC

How to preserve image metadata in MATLAB imwrite?

I want to preserve image metadata but my code strips all metadata. How do I stop this? I run this script from the MATLAB SDE command prompt. Code is below:
p = which('G0011363.JPG');
filelist = dir([fileparts(p) filesep '*.JPG']);
fileNames = {filelist.name};
fileNames_size = size(fileNames,2);
number_of_colums = fileNames_size;
for k = 1:number_of_colums
imwrite(undistortImage(imread(fileNames{k}), cameraParams2cof, 'OutputView', 'valid'), (strcat(int2str(k), 'R2_3COF_ONRcorrected.jpg')));
end
You can read in metadata using imfinfo, and you can write specific metadata to your image file with imwrite (as long as the particular tag is supported) as key/value pairs. Look at help imwrite for more info.
Example:
>> I = imread('NeverGonnaGiveYouUp.png');
>> imwrite(I, 'output.png', 'png','Author','Rick Astley');
>> Iinfo = imfinfo('output.png');
>> Iinfo.Author
ans =
Rick Astley
I found a solution, but it isn't perfect...
Note: The posted solution applies Windows OS.
Where referring to image metadata, I assume you mean Exif data.
According to https://www.mathworks.com/matlabcentral/answers/152559-writing-exif-data-to-jpg
Unfortunately, there is currently no off-the-shelf functionality to write EXIF data to an image file in MATLAB. You can only read EXIF data from an image file ( exifread and imfinfo ).
You can use run_exiftool do copy Exif data from one image to another:
Download and extract exiftool-10.25.zip
Copy file exiftool(-k).exe to your working folder, and rename file to exiftool.exe
Download run_exiftool from https://www.mathworks.com/matlabcentral/fileexchange/42000-run-exiftool, Copy getexif.m and putexif.m to your working folder.
Try the following code sample:
%Copy the file from c:\Program Files\MATLAB\R2014b\mcr\toolbox\matlab\demos\ to local folder.
%Note: ngc6543a.jpg is part of Matlab installation.
copyfile([matlabroot, '/mcr/toolbox/matlab/demos/ngc6543a.jpg'], cd);
%Read image
I = imread('ngc6543a.jpg');
%Save I to myfile.jpg and add Exif data of ngc6543a.jpg to myfile.jpg
status = putexif(I, 'myfile.jpg', 'ngc6543a.jpg');
%Read Exif data from ngc6543a.jpg
[ngc6543a_exifdata, ngc6543a_nf] = getexif('ngc6543a.jpg');
%Read Exif data from myfile.jpg
[myfile_exifdata, myfilenf] = getexif('myfile.jpg');
I am getting a warning message: Warning: Exif tags may not have been copied, but it seems to work.
Result:
>> ngc6543a_exifdata
ngc6543a_exifdata =
ExifToolVersion : 10.25
FileName : ngc6543a.jpg
Directory : .
FileSize : 27 kB
FileModifyDate : 2014:07:27 12:00:28+03:00
FileAccessDate : 2016:08:14 17:42:23+03:00
FileCreateDate : 2016:08:14 17:18:27+03:00
FilePermissions : rw-rw-rw-
FileType : JPEG
FileTypeExtension : jpg
MIMEType : image/jpeg
JFIFVersion : 1.01
ResolutionUnit : None
XResolution : 1
YResolution : 1
Comment : CREATOR: XV Version 3.00b Rev: 6/15/94 Quality = 75, Smoothing = 0.
ImageWidth : 600
ImageHeight : 650
EncodingProcess : Baseline DCT, Huffman coding
BitsPerSample : 8
ColorComponents : 3
YCbCrSubSampling : YCbCr4:2:0 (2 2)
ImageSize : 600x650
Megapixels : 0.390
>> myfile_exifdata
myfile_exifdata =
ExifToolVersion : 10.25
FileName : myfile.jpg
Directory : .
FileSize : 75 kB
FileModifyDate : 2016:08:14 18:08:51+03:00
FileAccessDate : 2016:08:14 18:08:51+03:00
FileCreateDate : 2016:08:14 17:40:22+03:00
FilePermissions : rw-rw-rw-
FileType : JPEG
FileTypeExtension : jpg
MIMEType : image/jpeg
JFIFVersion : 1.01
ResolutionUnit : None
XResolution : 1
YResolution : 1
Comment : CREATOR: XV Version 3.00b Rev: 6/15/94 Quality = 75, Smoothing = 0.
ImageWidth : 600
ImageHeight : 650
EncodingProcess : Baseline DCT, Huffman coding
BitsPerSample : 8
ColorComponents : 3
YCbCrSubSampling : YCbCr4:2:0 (2 2)
ImageSize : 600x650
Megapixels : 0.390

How to edit exif metadata by graphicsmagick command?

How to edit or add exif metadata by graphicsmagick command? I've tried the following:
gm convert -set EXIF:XPKeywords "bird, sleep, moon" bird.jpg bird2.jpg
My command is executing successfully and the image is creating but the exif metadata is not updating.
I don't believe you can do that with GraphicsMagick, and I would suggest exiv2 like this:
exiv2 -M"add Exif.Image.XPKeywords Ascii 'bird,sleep,moon'" image.jpg
Then you can view them with jhead too:
jhead -v image.jpg
JFIF SOI marker: Units: 0 (aspect ratio) X-density=1 Y-density=1
Exif header 50 bytes long
Exif section in Intel order
(dir has 1 entries)
Windows-XP keywords = "bird,sleep,moon"
Approximate quality factor for qtable 0: 92 (scale 16.28, var 1.13)
Approximate quality factor for qtable 1: 92 (scale 16.20, var 0.15)
JPEG image is 2000w * 2000h, 3 color components, 8 bits per sample
File name : image.jpg
File size : 6968929 bytes
File date : 2015:10:20 09:23:24
Resolution : 2000 x 2000