Problems with a Nikon image

Started by herb, July 18, 2013, 05:23:11 AM

Previous topic - Next topic

herb

Hello Phil,

From one of my friends I got a *.jpg image taken with a Nikon camera.
In order to see the internal structure, I made some output e.g. with -htmldump option and a second one with -a -v3 -all:all.
All went fine.

For further tests I added - with Exiftool - some GPS, IPTC, XMP and also MWG tags.
Then I tried to get again the output with -htmldump and also -a -v3.
But now Exiftool reports a warning: Error reading PreviewImage from file

As all changes have only be done with Exiftool I ask you to have a look into the file(s).
Because of the filesize, I feeled free to send them via mail.
I performed my tests with the windows version of Exiftool 9.32.

Thanks in advance
Herb

Phil Harvey

#1
Hi Herb,

Thanks for this report, and for the samples.  The problem is that your "original" image has already been modified by some other software, and the Preview image is already lost:

% exiftool Test_jpg_Nikon_xmp.jpg_original -previewimage
Warning: [minor] PreviewImage is not a valid JPEG image - Test_jpg_Nikon_xmp.jpg_original


However, one would expect ExifTool to warn about this when writing the image, but it doesn't.  I will look into this and report back when I have figured it out.

- Phil

Edit: I have taken a look.  Handling the PreviewImage is very tricky, and it is common for other software to remove the preview.  I think this may be the reason that I'm not issuing a warning here.  I certainly could add a warning, but I don't want to at this point because I fear that many ExifTool users would then start getting warnings that they don't care about for all of their images.

Edit2: Fixed typo
...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 ($).

herb

Hello Phil,

thanks for your quick reply and for the investigations.
I regret that I  opened the thread. But I really thought that the original image was only copied from the camera.

I also have some good news:
- Exiftool deleted the previewImage of the "corrupted image" without any errors or warnings,
- Exiftool added another "preview image" into that image, also without erros or warnings.
- I got an un-modified image (from that Nikon camera) and I have seen no problems adding tags.

Sorry again for causing these troubles.
Best regards
Herb