Hi Phil,
somehow I could not find any of my messages on the forum so I opened a new topic.
I am giving a final touch to the application I have written.
Interestingly enough the final thing is to write exif metadata to the image file.
The reason why I have started the project is to geocode and to write metadata to image file in the first place.
But in between so many interesting things happend regardind photos that it is now I am implementing it.
I would like to wite the following metadata to image file:
lat,
lon,
elevation,
utc time,
local time,
direction of camera regarding to true north.
direction of 300 m (or so) of gps track span distance where photo was taken regarding to true north,
magnetic north,
gps span distance in meters (300 m or so)
name, txt
description, txt
type, txt
symbol txt
How do I do that ?
Can it be done in one go ?
Do I have to invent any new tags or can I use existing/standard ones.
I am aware that not all information I would like to write is standardized.
best
Dusan
Hi Dusan,
Quote from: tadej on May 05, 2014, 09:59:18 AM
somehow I could not find any of my messages on the forum so I opened a new topic.
You mean this thread (https://exiftool.org/forum/index.php?topic=5177.0)?
QuoteHow do I do that ?
There are many, many different ways. The exact details of your implementation will depend on what is most convenient for you. A place to start would be the Writing Examples (https://exiftool.org/exiftool_pod.html#writing_examples) section of application documentation.
QuoteCan it be done in one go ?
Yes.
QuoteDo I have to invent any new tags or can I use existing/standard ones.
Most of your tags fit into standard EXIF (https://exiftool.org/TagNames/EXIF.html) and GPS tags (https://exiftool.org/TagNames/GPS.html). For any others, you can create user-defined tags (https://exiftool.org/config.html).
- Phil
Hi Phil,
yes it was that post. I did search for post holding my username but no results.
Thanks for the information. I will try to find a way how to squezze the information into image.
I can use command mode only because I am running exiftoll.exe as a process.
If there are any similar posts I woulde be happy to read them.
best
Dusan
I put a time in my photographs using the xmp datetimeoriginal. That way, you can put in a timezone so you can always work out utc if need be.
[EXIF] DateTimeOriginal : 2013:05:28 16:45:13
[XMP] DateTimeOriginal : 2013:05:28 16:45:13+02:00
Good suggestion Alan.
Or if you need to store UTC in EXIF, it can be done with GPSDateStamp and GPSTimeStamp.
- Phil
Quote from: Phil Harvey on May 07, 2014, 09:27:26 AM
Good suggestion Alan.
It was your suggestion originally. I can now keep my cameras on local time which I like much better. I take a photo of my watch showing local time and utc when I move timezones so I can match up the times using that photo and metadata.
Hi Phil,
I have constructed the following parameters string:
exiftool.exe " -gpsaltitude=76 -gpsaltituderef=above -gpslatituderef=north -gpslongituderef=west -gpslatitude=51.51791 -gpslongitude=-0.116849 -gpsdatestamp=2014:5:12 -gpstimestamp=18:15:54 C:\Users\Dusko23\Desktop\geotagged photos\2_DSCN0012.png"
When I execute (either in pure windows command mode or as process in my VB.net application) exiftool.exe takes some time (second or so) to finish. Nothing is returned.
I have used Bogdans software to look into png file.
It says EXIFtool was executed and No data
Any idea ?
Best regards,
Dusan
Hi Dusan,
Your quoting is wrong. Try this:
exiftool.exe -gpsaltitude=76 -gpsaltituderef=above -gpslatituderef=north -gpslongituderef=west -gpslatitude=51.51791 -gpslongitude=-0.116849 -gpsdatestamp=2014:05:12 -gpstimestamp=18:15:54 "C:\Users\Dusko23\Desktop\geotagged photos\2_DSCN0012.png"
Also, your month needs to be 2 digits.
- Phil
Hi Phil,
works like magic. Thanks. :)
I have also put days to two figures. But not hours, seconds and minutes.
Original files are considerably bigger than EXIFed ones. Any reason for that.
Thanks again,
Dusan
Hi Phil,
did browse documentation about XMP, IPCT tags but could not find something which might be used for TITLE, DESCPTION and TYPE ascii texts.
Any hint where to look at and example how to insert is highly appretiated.
Best regards,
Dusan
Hi Phil,
after succesfully geotagging with gps position, time and altitude I tried to do reverse geocoding.
exiftool -r -if "$gpsdatetime" -fileOrder gpsdatetime -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ pics > out.gpx
I am running on windows 7.
gpx track points contains the following data.
<trkpt lat="45.766894" lon="14.338573">
<ele>549</ele>
<time>m-H:SZ</time>
</trkpt>
What might be the reason for time values.
Best regards,
Dusan
Hi Dusan,
Quote from: tadej on May 19, 2014, 11:00:12 AM
Original files are considerably bigger than EXIFed ones. Any reason for that.
FAQ 13 (https://exiftool.org/faq.html#Q13) gives some reasons.
Quote from: tadej on May 19, 2014, 02:35:20 PM
did browse documentation about XMP, IPCT tags but could not find something which might be used for TITLE, DESCPTION and TYPE ascii texts.
You mean like XMP Description and Title? Not sure what you want to store in TYPE.
Quote from: tadej on May 19, 2014, 03:22:27 PM
<time>m-H:SZ</time>
</trkpt>
What might be the reason for time values.
Are you running the command directly or from a .bat file? In a bat file the "%" characters all need to be doubled.
- Phil
You mean like XMP Description and Title? Not sure what you want to store in TYPE.
Description, Title and Type are just strings from my database.
Type is the shortest, Description the longest and Title somewhere in between.
I can live without Type (will be appended to Title with some delimiter).
How do I concatenate a command to write Title and Description to XMP ? Or perhaps you have other suggestion where to insert the text. I would like to be in accordance with existing practice as much as possible, so that other software packages can read text infromation from image on the spot.
Are you running the command directly or from a .bat file? In a bat file the "%" characters all need to be doubled.
Yes I was running from bat file. I did double % characters and now all is fine. Just not sure about it's meanning.
A question here: when you create gpx time, which time do you take as track point time. Is it a GPS time and date I have inserted or it is Time Taken as defined by camera.
What happens if Lat and Lon are defined, but GPS time and date is not. Do you pull Time from Time Taken or what.
Best
Dusan
Quote from: tadej on May 19, 2014, 11:50:44 PM
How do I concatenate a command to write Title and Description to XMP ?
I thought this would have been obvious:
-title="some title" -description="some description" ...QuoteA question here: when you create gpx time, which time do you take as track point time.
Take a look at the .fmt file to see what tags are used.
- Phil
Hi Phil,
last couple of days I am quite active regarding EXIF wrapping up.
In order to manage my misson I have created and gathered several samples of images from accross the google and this is a table and example of values I have wrapped up.
Created by EXIFtool.exe image.xxx
I have run through many images in order to see all tags I need.
'Date/Time Original : 2014:05:17 11:16:09
'Create Date : 2014:05:17 11:16:09
'Camera Orientation : Rotate 270 CW
'GPS Latitude Ref : North
'GPS Longitude Ref : West
'GPS Altitude Ref : Above Sea Level
'GPS Time Stamp : 18:15:33
'GPS Date Stamp : 2014:05:12
'GPS Altitude : 57 m Above Sea Level
'GPS Date/Time : 2014:05:12 18:15:33Z
'GPS Latitude : 51 deg 31' 4.57" N
'GPS Longitude : 0 deg 7' 2.35" W
'GPS Position : 51 deg 31' 4.57" N, 0 deg 7' 2.35" W
'Orientation : Rotate 270 CW
'GPS Speed Ref : knots
'GPS Speed : 2
These are tags I need to extract from any picture which users will get or produce.
SURE there will be tags missing which is fine.
What I need is to be sure to interpret the values correctly.
And here are some of questions:
1. How stable are Tag names: for example is GPS Altitude Ref tag name fixed or does it cange in versions.
2. How stable are Tag values: for example does the structure and formatting : Above Sea Level always look like this or does it change in versions.
3. Some Tag values a bit descriptive. Rotate 270 CW for example or 57 m Above Sea Level . Can you please list or point to all of possible combinations for Camera rotation and GPS Altitude.
4. Is it possible to get similar values where Tag names would be like this: 0x9003 ?
5. Is it possible to write/read GPStime in fractions of seconds and how does that formatting look like ?
regards
Dusan
Hi Dusan,
Quote from: tadej on May 20, 2014, 07:17:51 AM
1. How stable are Tag names: for example is GPS Altitude Ref tag name fixed or does it cange in versions.
2. How stable are Tag values: for example does the structure and formatting : Above Sea Level always look like this or does it change in versions.
Very stable.
Quote3. Some Tag values a bit descriptive. Rotate 270 CW for example or 57 m Above Sea Level . Can you please list or point to all of possible combinations for Camera rotation and GPS Altitude.
See the Tag Name documentation (https://exiftool.org/TagNames/index.html).
Quote4. Is it possible to get similar values where Tag names would be like this: 0x9003 ?
You can add the
-H option to the command to see the tag ID's in hex.
Quote5. Is it possible to write/read GPStime in fractions of seconds and how does that formatting look like ?
> exiftool a.jpg -gpstimestamp=10:01:02.123456789
1 image files updated
> exiftool a.jpg -gpstimestamp
GPS Time Stamp : 10:01:02.123457
- Phil
Thanks Phil,
I'll stick to the ascii names because some GPS tags do not have HEX representation.
Best
Dusan
Hi Phil,
I have noticed that after I write GSPdata into image some original tags went missing.
I would like to reconstruct back the tag which tells when the image was originally taken.
From what I understand there are two tags which I should update:
Date/Time Original and Create Date
In this respect I have questions:
1. When I will read tags from original image (as created by camera) which tag is the right one if both tags are present but they show different values.
2. Would you know why both tags are neded. Is this a kind of EXIF missuse by camera creators or what ?
3. Can it happen that one tag is present and the other is not (image created by camera) ?
4. How do I format a command to write tag to image (is -createdate 2013:10:03 09:55:07.123 formated correctly , what is correct tag command for Date/Time Original) ?
Best regards,
Dusan
Quote from: tadej on May 22, 2014, 12:45:31 AM
I have noticed that after I write GSPdata into image some original tags went missing.
Using ExifTool? What tags went missing? This shouldn't happen.
QuoteFrom what I understand there are two tags which I should update:
Date/Time Original and Create Date
In this respect I have questions:
1. When I will read tags from original image (as created by camera) which tag is the right one if both tags are present but they show different values.
I can't answer this.
[/quote]2. Would you know why both tags are neded. Is this a kind of EXIF missuse by camera creators or what ?[/quote]
One tag is the date of the image content, and the other is the date the image was created. These are usually the same for digital pictures, but different for scanned images.
Quote3. Can it happen that one tag is present and the other is not (image created by camera) ?
I don't know.
Quote4. How do I format a command to write tag to image (is -createdate 2013:10:03 09:55:07.123 formated correctly ,
exiftool -createdate="2013:10:03 09:55:07.123" FILEQuotewhat is correct tag command for Date/Time Original) ?
The same, but use
-datetimeoriginal instead.
- Phil
QuoteUsing ExifTool? What tags went missing? This shouldn't happen.
Phil please find two images attached. Original and written one. Sorry server refused upload.
Yes, I do use EXIFtool. Sure.
This is concatenated cmd string.
-gpsaltitude=41 -gpsaltituderef=above -gpslatituderef=north -gpslongituderef=west -gpslatitude=51.525889 -gpslongitude=-0.11736 -gpsdatestamp=2014:05:14 -gpstimestamp=12:30:1 "C:\Users\Dusko23\Desktop\2_IMGA0189.jpg"Regards,
Dusan
You can email them to me (philharvey66 at gmail.com)
- Phil
I got the images, thanks.
> exiftool DSCN0021original.JPG -a -u -G1 >t1
> exiftool 16_DSCN0021gpstagswritten.jpg -a -u -G1 >t2
> diff t1 t2
2c2
< [System] File Name : DSCN0021original.JPG
---
> [System] File Name : 16_DSCN0021gpstagswritten.jpg
4,7c4,7
< [System] File Size : 2.7 MB
< [System] File Modification Date/Time : 2014:05:22 13:18:00-04:00
< [System] File Access Date/Time : 2014:05:22 13:18:10-04:00
< [System] File Inode Change Date/Time : 2014:05:22 13:18:00-04:00
---
> [System] File Size : 443 kB
> [System] File Modification Date/Time : 2014:05:22 13:18:04-04:00
> [System] File Access Date/Time : 2014:05:22 13:18:04-04:00
> [System] File Inode Change Date/Time : 2014:05:22 13:18:04-04:00
11,13c11,13
< [File] Exif Byte Order : Little-endian (Intel, II)
< [File] Image Width : 4000
< [File] Image Height : 3000
---
> [File] Exif Byte Order : Big-endian (Motorola, MM)
> [File] Image Width : 1000
> [File] Image Height : 750
17,23c17,23
< [File] Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1)
< [IFD0] Image Description :
< [IFD0] Make : NIKON
< [IFD0] Camera Model Name : COOLPIX S570
< [IFD0] Orientation : Horizontal (normal)
< [IFD0] X Resolution : 300
< [IFD0] Y Resolution : 300
---
> [File] Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
> [JFIF] JFIF Version : 1.01
> [JFIF] Resolution Unit : inches
> [JFIF] X Resolution : 96
> [JFIF] Y Resolution : 96
> [IFD0] X Resolution : 96
> [IFD0] Y Resolution : 96
25,117c25,36
< [IFD0] Software : COOLPIX S570V1.0
< [IFD0] Modify Date : 2014:05:13 13:00:27
< [IFD0] Y Cb Cr Positioning : Co-sited
< [ExifIFD] Exposure Time : 1/25
< [ExifIFD] F Number : 2.7
< [ExifIFD] Exposure Program : Program AE
< [ExifIFD] ISO : 400
< [ExifIFD] Exif Version : 0220
< [ExifIFD] Date/Time Original : 2014:05:13 13:00:27
< [ExifIFD] Create Date : 2014:05:13 13:00:27
< [ExifIFD] Components Configuration : Y, Cb, Cr, -
< [ExifIFD] Compressed Bits Per Pixel : 2
< [ExifIFD] Exposure Compensation : 0
< [ExifIFD] Max Aperture Value : 2.7
< [ExifIFD] Metering Mode : Multi-segment
< [ExifIFD] Light Source : Unknown
< [ExifIFD] Flash : Auto, Fired
< [ExifIFD] Focal Length : 5.0 mm
< [ExifIFD] User Comment :
< [ExifIFD] Flashpix Version : 0100
< [ExifIFD] Color Space : sRGB
< [ExifIFD] Exif Image Width : 4000
< [ExifIFD] Exif Image Height : 3000
< [ExifIFD] File Source : Digital Camera
< [ExifIFD] Scene Type : Directly photographed
< [ExifIFD] Custom Rendered : Normal
< [ExifIFD] Exposure Mode : Auto
< [ExifIFD] White Balance : Auto
< [ExifIFD] Digital Zoom Ratio : 0
< [ExifIFD] Focal Length In 35mm Format : 28 mm
< [ExifIFD] Scene Capture Type : Portrait
< [ExifIFD] Gain Control : High gain up
< [ExifIFD] Contrast : Normal
< [ExifIFD] Saturation : Normal
< [ExifIFD] Sharpness : Normal
< [ExifIFD] Subject Distance Range : Unknown
< [Nikon] Maker Note Version : 2.00
< [Nikon] ISO : 0
< [Nikon] Color Mode : Color
< [Nikon] Quality : Normal
< [Nikon] White Balance : Auto
< [Nikon] Sharpness : Auto
< [Nikon] Focus Mode : AF-S
< [Nikon] Flash Setting : Normal
< [Nikon] Nikon 0x000a : 7.791
< [Nikon] White Balance Fine Tune : 0
< [Nikon] ISO Selection : Auto
< [Nikon] Data Dump : (Binary data 1 bytes, use -b option to extract)
< [Nikon] Image Processing :
< [Nikon] Face Detect Frame Size : 320 240
< [Nikon] Faces Detected : 0
< [Nikon] Nikon 0x0026 : 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
< [Nikon] Nikon 0x002d : 256 0
< [Nikon] Nikon 0x002e : 1
< [Nikon] Nikon 0x002f : 0
< [Nikon] Nikon 0x0030 : 0
< [Nikon] Image Adjustment : Normal
< [Nikon] Manual Focus Distance : undef
< [Nikon] Digital Zoom : 1
< [Nikon] AF Area Mode : Single Area
< [Nikon] AF Point : Center
< [Nikon] AF Points In Focus : Center
< [Nikon] Scene Mode :
< [Nikon] Saturation : 0
< [Nikon] Noise Reduction : Off
< [Nikon] Nikon 0x009b : 0 0
< [Nikon] Scene Assist :
< [Nikon] Nikon 0x009d : 0
< [Nikon] Retouch History : None
< [Nikon] Nikon 0x009f : 0
< [Nikon] Image Stabilization : VR-Off
< [Nikon] Nikon 0x00b2 : Normal
< [Nikon] Nikon 0x00b5 : 4113
< [Nikon] Nikon 0xf000 :
< [Nikon] Nikon 0xf001 : 0
< [PreviewIFD] Compression : JPEG (old-style)
< [PreviewIFD] X Resolution : 300
< [PreviewIFD] Y Resolution : 300
< [PreviewIFD] Resolution Unit : inches
< [PreviewIFD] Preview Image Start : 2694
< [PreviewIFD] Preview Image Length : 19841
< [PreviewIFD] Y Cb Cr Positioning : Co-sited
< [InteropIFD] Interoperability Index : R98 - DCF basic file (sRGB)
< [InteropIFD] Interoperability Version : 0100
< [IFD1] Compression : JPEG (old-style)
< [IFD1] X Resolution : 300
< [IFD1] Y Resolution : 300
< [IFD1] Resolution Unit : inches
< [IFD1] Thumbnail Offset : 33674
< [IFD1] Thumbnail Length : 5565
< [Composite] Aperture : 2.7
< [Composite] Base Name : DSCN0021original
< [Composite] File Extension : JPG
---
> [IFD0] Y Cb Cr Positioning : Centered
> [GPS] GPS Version ID : 2.3.0.0
> [GPS] GPS Latitude Ref : North
> [GPS] GPS Latitude : 51.517053
> [GPS] GPS Longitude Ref : West
> [GPS] GPS Longitude : 0.114046
> [GPS] GPS Altitude Ref : Above Sea Level
> [GPS] GPS Altitude : 45 m
> [GPS] GPS Time Stamp : 10:59:09
> [GPS] GPS Date Stamp : 2014:05:13
> [Composite] Base Name : 16_DSCN0021gpstagswritten
> [Composite] File Extension : jpg
119,130c38,44
< [Composite] Image Size : 4000x3000
< [Composite] Physical Image Size : 13.3x10.0 inches
< [Composite] Preview Image : (Binary data 19841 bytes, use -b option to extract)
< [Composite] Scale Factor To 35 mm Equivalent: 5.6
< [Composite] Shutter Speed : 1/25
< [Composite] Thumbnail Image : (Binary data 5565 bytes, use -b option to extract)
< [Composite] Big Image : (Binary data 19841 bytes, use -b option to extract)
< [Composite] Circle Of Confusion : 0.004 mm
< [Composite] Field Of View : 65.5 deg
< [Composite] Focal Length : 5.0 mm (35 mm equivalent: 28.0 mm)
< [Composite] Hyperfocal Distance : 2.10 m
< [Composite] Light Value : 5.5
---
> [Composite] GPS Altitude : 45 m Above Sea Level
> [Composite] GPS Date/Time : 2014:05:13 10:59:09Z
> [Composite] GPS Latitude : 51.517053 N
> [Composite] GPS Longitude : 0.114046 W
> [Composite] GPS Position : 51.517053 N, 0.114046 W
> [Composite] Image Size : 1000x750
> [Composite] Physical Image Size : 10.4x7.8 inches
So the Nikon information is missing from the modified file. But the file was also resized by some software. I blame that software for the loss of this information.
I don't see this problem when I then try to reproduce your steps using ExifTool alone:
> exiftool DSCN0021original.JPG -gpsaltitude=41 -gpsaltituderef=above -gpslatituderef=north -gpslongituderef=west -gpslatitude=51.525889 -gpslongitude=-0.11736 -gpsdatestamp=2014:05:14 -gpstimestamp=12:30:1
1 image files updated
> exiftool DSCN0021original.JPG -a -u -G1 >t2
> diff t1 t2
5,7c5,7
< [System] File Modification Date/Time : 2014:05:22 13:18:00-04:00
< [System] File Access Date/Time : 2014:05:22 13:18:10-04:00
< [System] File Inode Change Date/Time : 2014:05:22 13:18:00-04:00
---
> [System] File Modification Date/Time : 2014:05:22 13:20:23-04:00
> [System] File Access Date/Time : 2014:05:22 13:20:23-04:00
> [System] File Inode Change Date/Time : 2014:05:22 13:20:23-04:00
104c104
< [PreviewIFD] Preview Image Start : 2694
---
> [PreviewIFD] Preview Image Start : 8622
108a109,117
> [GPS] GPS Version ID : 2.3.0.0
> [GPS] GPS Latitude Ref : North
> [GPS] GPS Latitude : 51.525889
> [GPS] GPS Longitude Ref : West
> [GPS] GPS Longitude : 0.117360
> [GPS] GPS Altitude Ref : Above Sea Level
> [GPS] GPS Altitude : 41 m
> [GPS] GPS Time Stamp : 12:30:01
> [GPS] GPS Date Stamp : 2014:05:14
113c122
< [IFD1] Thumbnail Offset : 33674
---
> [IFD1] Thumbnail Offset : 3056
118a128,132
> [Composite] GPS Altitude : 41 m Above Sea Level
> [Composite] GPS Date/Time : 2014:05:14 12:30:01Z
> [Composite] GPS Latitude : 51.525889 N
> [Composite] GPS Longitude : 0.117360 W
> [Composite] GPS Position : 51.525889 N, 0.117360 W
- Phil
Thanks Phil,
yes my software does several resizining in order to create task dependat images all in 100% Q jpg.
Original image, Panoramio/Picasa size, KML Thumbnail image, KML balloon image, TimeLine image.
And yes they all lost most of Tags. Unfortunately I did realize it after I inserted GPSdata.
Sorry for confusion ;).
Regards,
Dusan