Internal error while rewriting IFD0 - NEF Files

Started by Archive, May 12, 2010, 08:53:51 AM

Previous topic - Next topic

Archive

[Originally posted by aneumann on 2005-10-12 16:11:28-07]

Hello,

I have a perl script that runs perfectly fine with Jpeg files - reading and setting some Exif and IPTC tags.

When I try the same script on NEF files, it fails after doing the WriteInfo method.
Code:
$success = $exifTool->WriteInfo($file, $dest_file);

One example NEF file can be found at http://www.carto.net/neumann/temp/DSC_0009.NEF - one of the files I tried the script on.

Writing meta-information in JPEG files is fine, but I would much prefer to store the metadata in the original NEF files (digital negatives) if this is possible.

Is there any way I can convince my script to write the metadata to the NEF files? Are there known problems with NEF files that I am not aware of?

Would it be useful to post the full perlscript?

Thanks for any info on the topic,

Andreas

Archive

[Originally posted by exiftool on 2005-10-12 16:38:22-07]

Hi agan Andreas,

You seem to have found a bug in ExifTool that I haven't seen.  It should be able to write NEF files with no problem.  I downloaded your NEF file tried writing a bunch of different information to it without any problems.  I may be able to figure out what is going wrong for you if I can see your script to see exactly what you are doing.

Archive

[Originally posted by aneumann on 2005-10-13 07:38:12-07]

Hi,

I created a tar.gz archive containing my perl script, a gpx tracklog file, 3 jpegs and 3 nef files and a readme.txt. The script tries to synchronize the GPS data with the photo data using a timestamp match. It also allows to set some metadata.

The readme contains the commandline syntax to invoke the script.

The archive is at http://www.carto.net/neumann/temp/gpsPhoto.tar.gz (ca 18 Megs, hope its not too big, the NEF files are rather big)

If the script is too complex, I can do further investigations and do a simpler script just with the ExifTool part, trying to replicate the problem.

Let me know, if you need further infos from my side.

Thanks a lot for taking the time to have a look at my problem.

All the best,
Andreas

Archive

[Originally posted by exiftool on 2005-10-13 13:32:12-07]

Andreas,

Thank you very much for providing this tarball to allow me to duplicate your error.  I needed to install 6 (!) other packages to get your script to run, but after that it worked fine and I was able to reproduce and solve the problem.

The problem was a sneaky one, and would have occured only with Perl 5.8 or later.  It was caused by passing a UTF-8 encoded string to SetNewValue(), which had the unfortunate side-effect of propagating the internal Perl UTF-8 flag into the binary EXIF data.  This caused problems with my algorithms since they are based on byte manipulations, but the problems were caught by internal checks, so no files would have been corrupted.

I have just released ExifTool version 5.67 which should fix this.  It is a production version, and is now available from the ExifTool web site.

Archive

[Originally posted by aneumann on 2005-10-13 19:57:28-07]

Hi Phil,

Thanks for providing the fix. This was very fast!

I downloaded the new version and can confirm that it works now. Great!

I will finish and document my script and post it on my website. Maybe it is of use for someone.

Thanks again and all the best,
Andreas