ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: IUnknown on June 10, 2022, 07:26:41 AM

Title: Samsung: TimeStamp information is truncated to seconds
Post by: IUnknown on June 10, 2022, 07:26:41 AM
Hello,

I'm trying to organize all my media files following the naming convention:

%Y%m%d-%H%M%S%3f

exiftool.exe -d "%Y%m%d-%H%M%S%3f%%-c.%%e" "-testname<SubSecDateTimeOriginal" test.heic

It worked just fine for all iPhone media files. But it doesn't work as expected for Samsung (https://github.com/exiftool/exiftool/blob/48df8aae22faa33d830dcf2ecdf406998b4d3849/lib/Image/ExifTool/Samsung.pm#L994=) S21 files. All Samsung files renamed using the format above have 000 for fractional seconds at the end of their names.

I can see TimeStamp information is present in metadata:

exiftool.exe -v2 test.heic
  SamsungTrailer (SubDirectory) -->
  - Tag 'sefd' (98 bytes)
  + [SamsungTrailer directory]
  | SamsungTrailer_0x0a01Name = Image_UTC_Data
  | - Tag '0x0a01-name' (14 bytes)
  | TimeStamp = 1630590055469
  | - Tag '0x0a01' (13 bytes)
  | SamsungTrailer_0x0aa1Name = MCC_Data
  | - Tag '0x0aa1-name' (8 bytes)
  | MCCData = 255
  | - Tag '0x0aa1' (3 bytes)


TimeStamp = 1630590055469 which is Thursday, 2 September 2021, 13:40:55.469 GMT. But fractional seconds are truncated when I try to extract this information:

exiftool.exe -b -TimeStamp test.heic
2021:09:02 16:40:55+03:00

Is it possible to read Raw (https://exiftool.org/under.html#conversions) information from EXIF?

I also tried this command:

exiftool.exe -b -SamsungTrailer_0x0a01 -u test.heic

But it doesn't return value at all. However the command below returns Image_UTC_Data

exiftool.exe -b -SamsungTrailer_0x0a01Name -u test.heic
Title: Re: Samsung: TimeStamp information is truncated to seconds
Post by: Phil Harvey on September 19, 2022, 11:25:08 AM
Reading the raw value is only possible with the -v option.

But I will patch ExifTool 12.46 to return the fractional seconds in the local time zone, eg)

2021:09:02 16:40:55.469+03:00
Thanks for pointing out this loss of precision.

- Phil
Title: Re: Samsung: TimeStamp information is truncated to seconds
Post by: IUnknown on October 15, 2022, 04:18:00 PM
Thanks Phil! I upgraded ExifTool to v12.46 and now I can extract TimeStamp information. Btw, is it possible to remove dot produced by %f? In the example below I would like to get file name '20210902-164055469.heic':

exiftool.exe -d "%Y%m%d-%H%M%S%3f%%-c.%%e" "-testname<SubSecDateTimeOriginal" "-testname<TimeStamp" ./test/test.heic

'./test/test.heic' --> './test/20210902-164055.469.heic'
    0 image files updated
    1 image files unchanged
Title: Re: Samsung: TimeStamp information is truncated to seconds
Post by: Phil Harvey on October 15, 2022, 04:38:23 PM
Currently you would have to removed the "." using the advanced-formatting option:

exiftool.exe -d "%Y%m%d-%H%M%S%3f%%-c.%%e" "-testname<${SubSecDateTimeOriginal;s/\.//}" "-testname<${TimeStamp;s/\.//}" ./test/test.heic

But in ExifTool 12.49 release I'll add a "-" feature to allow the decimal to be dropped:

exiftool.exe -d "%Y%m%d-%H%M%S%-3f%%-c.%%e" "-testname<SubSecDateTimeOriginal" "-testname<TimeStamp" ./test/test.heic

- Phil
Title: Re: Samsung: TimeStamp information is truncated to seconds
Post by: IUnknown on October 31, 2022, 07:36:13 PM
Works like a charm! Thank you for your help Phil, appreciate all the efforts you put in ExifTool.