It was only meant as a quick fix because it still leaves problems. The temp file now gets written to the current directory so there are two possible errors now:
1) The same error if the current path is on a different filesystem to the photo
2) The user doesn't have write access to the current directory
At least with the patch you can work around these in Python. I think the temp file should be in the same directory as the photo; it was just the limit of my C to delete a few characters from a string! (Although I'll stick my neck out and suggest that the fclose()'s should happen before the rename?)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the update. I'm on a long travel right now until mid-November, so I'm not really doing much libiptcdata development at the moment, but I'll take a more thorough look at this when I return. Send me an email around then if you don't hear from me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Quick fix to /tmp filesystem problem
Logged In: YES
user_id=808349
Originator: YES
File Added: libiptcdata-1.0.2-tmp.patch
Logged In: YES
user_id=761
Originator: NO
Chris,
Thanks for finding this. Your patch has been committed to the CVS version of libiptcdata.
Logged In: YES
user_id=808349
Originator: YES
It was only meant as a quick fix because it still leaves problems. The temp file now gets written to the current directory so there are two possible errors now:
1) The same error if the current path is on a different filesystem to the photo
2) The user doesn't have write access to the current directory
At least with the patch you can work around these in Python. I think the temp file should be in the same directory as the photo; it was just the limit of my C to delete a few characters from a string! (Although I'll stick my neck out and suggest that the fclose()'s should happen before the rename?)
Logged In: YES
user_id=808349
Originator: YES
Here's my attempt at a more complete fix. Definitely needs checking!
File Added: libiptcdata-1.0.2-py-filesystem.patch
Better fix using image directory instead of full path
Logged In: YES
user_id=808349
Originator: YES
Improved patch to use the image's directory instead of full name for temp file template and use mkstemp instead of mktemp.
File Added: libiptcdata-1.0.2-py-path.patch
Logged In: YES
user_id=761
Originator: NO
Thanks for the update. I'm on a long travel right now until mid-November, so I'm not really doing much libiptcdata development at the moment, but I'll take a more thorough look at this when I return. Send me an email around then if you don't hear from me.
Better late than never.... I've updated CVS to your latest patch. I will be doing a new release shortly.