Deletion of unknown MakerNote / Support for Nokia MakerNote

Started by stream, December 27, 2011, 05:22:19 AM

Previous topic - Next topic

stream

I'm using ExifTool for a long time to optimize pictures by removing some heavy EXIG tags, especially MakerNote(s). It worked fine with MakerNoteMinolta, MakerNoteOlympus, etc. Unfortunately, it failed on photos taken by my Nokia phone. ExifTool does not recognize Nokia MakerNote and refuses to process them, even if I'm trying to delete block completely:

H:\Progs\ExifTool>exiftool.exe -o tmp -MakerNoteUnknown= 2011-08-14_11-11-29.jpg
Warning: [minor] Maker notes could not be parsed - 2011-08-14_11-11-29.jpg
    1 image files copied

Tried to replace -MakerNoteUnknown with just -makernotes, same effect.

So, is it possible to delete unrecognized MakerNotes or detection code must be added to ExifTool first? (consider this post as a feature request then)

Nokia MakerNotes seems to be a big binary object without any human-recognizable patterns, may be it's just a preview. Few bytes in the beginning could be some kind of header (D0, 32 look like a length of the block, 0x32D0 == 13008). PM me for full file examples.

  ExifByteOrder = II
  + [IFD0 directory with 7 entries]
  | 0)  Make = Nokia
  |     - Tag 0x010f (6 bytes, string[6]):
  |         006e: 4e 6f 6b 69 61 00                               [Nokia.]
  | 1)  Model = E5-00
  |     - Tag 0x0110 (6 bytes, string[6]):
  |         0074: 45 35 2d 30 30 00                               [E5-00.]
  | 2)  XResolution = 300 (300/1)
  |     - Tag 0x011a (8 bytes, rational64u[1]):
  |         007a: 2c 01 00 00 01 00 00 00                         [,.......]
  | 3)  YResolution = 300 (300/1)
  |     - Tag 0x011b (8 bytes, rational64u[1]):
  |         0082: 2c 01 00 00 01 00 00 00                         [,.......]
  | 4)  ResolutionUnit = 2
  |     - Tag 0x0128 (2 bytes, int16u[1]):
  |         004e: 02 00                                           [..]
  | 5)  YCbCrPositioning = 1
  |     - Tag 0x0213 (2 bytes, int16u[1]):
  |         005a: 01 00                                           [..]
  | 6)  ExifOffset (SubDirectory) -->
  |     - Tag 0x8769 (4 bytes, int32u[1]):
  |         0066: 7e 00 00 00                                     [~...]
  | + [ExifIFD directory with 26 entries]
  | | 0)  ExposureTime = 0.010003 (10003/1000000)
  | |     - Tag 0x829a (8 bytes, rational64u[1]):
  | |         01c8: 13 27 00 00 40 42 0f 00                         [.'..@B..]
  | | 1)  FNumber = 2.4 (24/10)
  | |     - Tag 0x829d (8 bytes, rational64u[1]):
  | |         01d0: 18 00 00 00 0a 00 00 00                         [........]
  | | 2)  ISO = 100
  | |     - Tag 0x8827 (2 bytes, int16u[1]):
  | |         00ac: 64 00                                           [d.]
  | | 3)  ExifVersion = 0220
  | |     - Tag 0x9000 (4 bytes, undef[4]):
  | |         00b8: 30 32 32 30                                     [0220]
  | | 4)  DateTimeOriginal = 2011:08:14 11:11:29
  | |     - Tag 0x9003 (20 bytes, string[20]):
  | |         01d8: 32 30 31 31 3a 30 38 3a 31 34 20 31 31 3a 31 31 [2011:08:14 11:11]
  | |         01e8: 3a 32 39 00                                     [:29.]
  | | 5)  CreateDate = 2011:08:14 11:11:29
  | |     - Tag 0x9004 (20 bytes, string[20]):
  | |         01ec: 32 30 31 31 3a 30 38 3a 31 34 20 31 31 3a 31 31 [2011:08:14 11:11]
  | |         01fc: 3a 32 39 00                                     [:29.]
  | | 6)  ComponentsConfiguration = 1 2 3 0
  | |     - Tag 0x9101 (4 bytes, undef[4] read as int8u[4]):
  | |         00dc: 01 02 03 00                                     [....]
  | | 7)  ShutterSpeedValue = 6.643 (6643/1000)
  | |     - Tag 0x9201 (8 bytes, rational64s[1]):
  | |         0200: f3 19 00 00 e8 03 00 00                         [........]
  | | 8)  ApertureValue = 1.4 (140/100)
  | |     - Tag 0x9202 (8 bytes, rational64u[1]):
  | |         0208: 8c 00 00 00 64 00 00 00                         [....d...]
  | | 9)  LightSource = 0
  | |     - Tag 0x9208 (2 bytes, int16u[1]):
  | |         0100: 00 00                                           [..]
  | | 10) Flash = 24
  | |     - Tag 0x9209 (2 bytes, int16u[1]):
  | |         010c: 18 00                                           [..]
  | | 11) FocalLength = 3.35 (335/100)
  | |     - Tag 0x920a (8 bytes, rational64u[1]):
  | |         0210: 4f 01 00 00 64 00 00 00                         [O...d...]
  | | 12) MakerNoteUnknown (SubDirectory) -->
  | |     - Tag 0x927c (13008 bytes, undef[13008]):
  | |         0218: 12 29 09 08 d0 32 00 80 82 22 30 f7 bd a7 82 d4 [.)...2..."0.....]
  | |         0228: d6 2b 0b 56 1e 67 ce 76 bf 30 71 0e 07 0a 80 fe [.+.V.g.v.0q.....]
  | |         0238: 74 ec a2 40 52 4b 52 95 a4 c9 f6 1c 13 4b 72 f8 [t..@RKR......Kr.]
  | |         0248: fa d4 a2 8b 31 3a a7 ea d7 8d 01 6b 2c a5 52 de [....1:.....k,.R.]
  | |         0258: dd ef 92 f8 07 6c 85 93 4d 30 1f 78 22 fa f5 c4 [.....l..M0.x"...]
  | |         0268: 7a 7f 33 92 b5 8b 4a a1 ed 65 b8 a3 4c 9e 18 8a [z.3...J..e..L...]
  | |         0278: 39 f6 00 f5 b3 1c 68 6b e0 19 ca 8f dc 1b c8 1d [9.....hk........]
  | |         0288: c1 34 d2 77 a3 c8 f6 fe 7a 35 55 a6 db 4f ba 39 [.4.w....z5U..O.9]
(and so on)


Phil Harvey

Writing the makernotes as a block is complicated, and it doesn't always work as expected.  I will look into fixing this, but until then the recommended way to delete maker notes is by group:

exiftool -makernotes:all= ...

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

stream

Thank, this syntax worked. I think there is a small syntax ambiguity which confused me: to delete whole group of notes, I've used (and exiftool successfully accepted) -MakerNoteMinolta=, -MakerNoteOlympus=, -MakerNoteOlympus2=, -MakerNotePanasonic=, -MakerNotePentax=, etc (there are ones which I've really tried). But it didn't accept -makernotes= for unknown notes, only -makernotes:all works.

Phil Harvey

You're right.  This is something that needs fixing, but it isn't as simple as one might hope.  I'll work on getting this fixed for the next release (version 8.74).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Version 8.74 is now available, and should solve this problem.

Thanks for the bug report.

- Phil

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).