Canon PowerShot ELPH 330 HS MakerNotes support

Started by Jonathan, May 24, 2013, 01:57:32 PM

Previous topic - Next topic

Jonathan

What thumbnail? Is your tool calculating this 72 value and discarding the source value?
I don't think the destination file has a thumbnail, or at least I didn't specifically create it unless Imager does that by default.

Jonathan

I know nothing of file formats, so don't know how to interpret. Here's the output for the 3 files:

Original:
[IFD1]          Compression                     : JPEG (old-style)
[IFD1]          X Resolution                    : 180
[IFD1]          Y Resolution                    : 180
[IFD1]          Resolution Unit                 : inches
[IFD1]          Thumbnail Offset                : 5632
[IFD1]          Thumbnail Length                : 4327

Imager file has no IFD1

Final file:
[IFD1]          Compression                     : JPEG (old-style)
[IFD1]          X Resolution                    : 72
[IFD1]          Y Resolution                    : 72
[IFD1]          Resolution Unit                 : inches
[IFD1]          Thumbnail Offset                : 4968
[IFD1]          Thumbnail Length                : 4327

If a thumbnail is being copied over by the SetNewValuesFromFile(), that's not a good thing because it would have the wrong orientation. Might be better to exclude it from the copy (how?). That said, maybe I don't care since nothing I use would display it anyway.

Jonathan

Of course, the tool is discarding the MPF group entirely. I notice it says (in the original file):
---- MPF ----
MPFVersion               : 0100
NumberOfImages           : 2
MPImageFlags (1)         : Dependent parent image
MPImageFormat (1)        : JPEG
MPImageType (1)          : Baseline MP Primary Image
MPImageLength (1)        : 3759050
MPImageStart (1)         : 0
DependentImage1EntryNumber (1) : 2
DependentImage2EntryNumber (1) : 0
MPImageFlags             : Dependent child image
MPImageFormat            : JPEG
MPImageType              : Large Thumbnail (full HD equivalent)
MPImageLength            : 322715
MPImageStart             : 3759104
DependentImage1EntryNumber : 0
DependentImage2EntryNumber : 0

Phil Harvey

Do this to exclude the thumbnail from being copied:

$cleanExifTool->SetNewValuesFromFile($originalFilePath, '-thumbnailimage');

This is the only tag with a default write group of IFD1, so if you don't write this then ExifTool will not populate the other mandatory IFD1 tags with default values.

- 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 ($).

Jonathan

I restricted the groups as well, so my final command is this:
SetNewValuesFromFile($originalFilePath, '*:*', '-ThumbnailImage')

dma_k

Quote from: Phil Harvey on May 25, 2013, 12:58:38 PM
You really can't call SetNewValue() to do this.  You have the correct syntax for SetNewValuesFromFile().  (either "makernotes:*" or "makernotes:all" should work).  But you should also set the Make and Model, like this:
Actually I've tried makernotes:* as tag argument for SetNewValuesFromFile() but it didn't work (Image::ExifTool v10.37). Only makernotes works fine. Would be nice if makernotes:* and makernotes:all are aliases for makernotes just for consistency.

Phil Harvey

MakerNotes:* and MakerNotes have very different functionality.  MakerNotes:* copies the makernotes tags individually (and hence won't create a makernote block if it doesn't already exist), and MakerNotes copies the makernotes as a block.

- 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 ($).