Project

General

Profile

Tiff and windows 7 ( exiv2 0.19 )

Added by fab mic about 9 years ago

Hi all,
I have compiled exiv2 library for windows 7 64 bits with visual 2008.
I create a tiff file, and then I write some metadata using exiv2 in that same file.
I call the function : writeMetadata() in my code.
Just after the call to that function, the size of my tiff files becomes zero.
The file is still there but its size is zero.

My code works perfectly on linux, so it is a platform specific problem.
Does anyone experience such a thing ?
Best regards,
Fabien


Replies (8)

RE: Tiff and windows 7 ( exiv2 0.19 ) - Added by Andreas Huggel about 9 years ago

This sounds like issue #668. Except that #668 is not a platform specific issue and you say it works on Linux but not on Windows 7.
Nevertheless, can you try exiv2 from SVN on Windows first? (#668 is fixed in the trunk version)
If that doesn't help, can you provide a small reproducer that demonstrates the problem?

Andreas

RE: Tiff and windows 7 ( exiv2 0.19 ) - Added by Robin Mills about 9 years ago

If Andreas' suggestion doesn't fix things, please upload a project and code and I'll look at this on Windows7. I'm out on Saturday, so it'll be Sunday in California before I can investigate.

Robin

RE: Tiff and windows 7 ( exiv2 0.19 ) - Added by fab mic about 9 years ago

Hi,
I have investigated, and it is not only for Tiff file. I reproduced the error with JPEG one.
I compiled the example addmodel.cpp, and launch it on a JPEG file.
The output is :

C:\testExiv2.exe IMG_5010.JPG

Added a few tags the quick way.
Added key "Exif.Photo.DateTimeOriginal", value "1999:12:31 23:59:59"
Added key "Exif.Image.PrimaryChromaticities", value "1/2 1/3 2/3 3/4"
Modified key "Exif.Image.PrimaryChromaticities", new value "2000:12:31 23:59:59"

Modified key "Exif.Image.PrimaryChromaticities", new value "1/2 1/3 88/77 3/4"
Deleted key "Exif.Image.PrimaryChromaticities"
Caught Exiv2 exception 'IMG_5010.JPG6700: Failed to rename file to ÓÄ↓: No such
file or directory (errno = 2)'

It looks like the name of the file has been corrupted.
The size of the JPEG file is 0 at the end of the process.
Any ideas ?
Fabien

RE: Tiff and windows 7 ( exiv2 0.19 ) - Added by Andreas Huggel about 9 years ago

Is the temporary file IMG_5010.JPG6700 still around? More importantly, what compiler did you use to build exiv2?
Robin, maybe you can try to reproduce this.

Andreas

RE: Tiff and windows 7 ( exiv2 0.19 ) - Added by fab mic about 9 years ago

Ok, I use visual 2008.
During my tests, I found that i used the configuration file of exv_msvc.h of 0.18 so i replace with the one of 0.19.

It does not complain anymore, but it still replace the image with an empty file.

C:\testExiv2.exe IMG_5010.JPG
Added a few tags the quick way.
Added key "Exif.Photo.DateTimeOriginal", value "1999:12:31 23:59:59"
Added key "Exif.Image.PrimaryChromaticities", value "1/2 1/3 2/3 3/4"
Modified key "Exif.Image.PrimaryChromaticities", new value "2000:12:31 23:59:59"

Modified key "Exif.Image.PrimaryChromaticities", new value "1/2 1/3 88/77 3/4"
Deleted key "Exif.Image.PrimaryChromaticities"

The IMG_5010.JPG6700 is not there.
It looks like it does everything but it can not write the file at the end.
What function are used to write the files ftream, fopen, ... ?

Does anyone make it work on win 7 ?

Thanks for helping me,
Fabien

RE: Tiff and windows 7 ( exiv2 0.19 ) - Added by Andreas Huggel about 9 years ago

Fabien,

Please build exiv2 from scratch, using the code from SVN and test with that, before we embark on a witchhunt.

The rename() function is used to rename a temporary file to the final image. Then remove() is called to remove the temporary file.
See FileIo::transfer in basicio.cpp

Andreas

RE: Tiff and windows 7 ( exiv2 0.19 ) - Added by Andreas Huggel about 9 years ago

The rename() function is used to rename a temporary file to the final image. Then remove() is called to remove the temporary file.
See FileIo::transfer in basicio.cpp

Note that this happens only for images > 1MB, for smaller files we use a memory buffer rather than a temporary file.

RE: Tiff and windows 7 ( exiv2 0.19 ) - Added by fab mic about 9 years ago

Andreas,
I checkout trunk and compile.
It works with the version in the SVN.
Note I add to comment the function htonl in order to compile in the method sony_decrypt
When will be the next release of exiv2 ?
Thanks,
Fabien

    (1-8/8)