After running exifautotran some files (the files which have been transformed) do not have the file mode (file permissions) they had before transformation unless the file mode was 600. Reproducible: Always Steps to reproduce: 1. Find a JPEG file where the EXIF data says the image requires rotation (<http://www.ferretporn.se/~mrlemming/bugs/MVI_0216.jpg>) 2. Find another JPEG file where the EXIF data says the image does not require rotation (<http://www.ferretporn.se/~mrlemming/bugs/MVI_0216-rotated.jpg>) 3. Set file modes to 644 on the two JPEG files 4. Run exifautotran on the two JPEG files Actual results: The file modes of the two files differ from each other and, in the case of the JPEG file which underwent transformation, is different (600) from the original file mode (644). Expected results: The file modes are the same for all JPEG files, and the same as they were before the transformation (644). Some suggestions on fixes (none of which suppress any messages or display warnings if commands fail) follow: Simple fix to use chmod before mv: --- /usr/bin/exifautotran 2007-02-27 20:31:07.000000000 +0100 +++ /home/mrlemming/bin/exifautotran 2007-06-13 21:36:13.000000000 +0200 @@ -43,6 +43,7 @@ if test $? -ne 0; then echo Error while transforming $i - skipped. >&2 else + chmod "$tempfile" --reference="$i" if mv "$tempfile" "$i"; then jpegexiforient -1 "$i" > /dev/null fi More complicated (and slightly more secure) fix which runs stat before and chmod after mv: --- /usr/bin/exifautotran 2007-02-27 20:31:07.000000000 +0100 +++ /home/mrlemming/bin/exifautotran 2007-06-13 21:49:51.000000000 +0200 @@ -43,7 +43,12 @@ if test $? -ne 0; then echo Error while transforming $i - skipped. >&2 else + oldmode=`stat -c%a "$i"` + oldmode_rc=$? if mv "$tempfile" "$i"; then + if test $oldmode_rc -eq 0; then + chmod $oldmode "$i" + fi jpegexiforient -1 "$i" > /dev/null fi fi
*** This bug has been marked as a duplicate of bug 206285 ***