Open GoogleCodeExporter opened 8 years ago
Complement on exiftran:
When running exiftran on a picture belonging to another user (root for the
test, but with writing rights), the message is:
processing p20101024-p1140170.jpg
fchown(p20101024-p1140170.jpg.AGEryJ): Operation not permitted
if no writing rights, then the message is:
processing p20101024-p1140170.jpg
access p20101024-p1140170.jpg: Permission denied
Unfortunately, exiftran sends all output to stderr (not very smart...), and
finding "processing" in stderr (as is checked in tools.py : Command._run) is
not enough.
I think that instead, we could check:
- that all lines *do* contain "processing" (drop all "processing" lines and
check if there is something left ?)
- the return code of the command (0 if OK, 1 if not)
***
Besides, I think there is an indentation problem in this part of code, since
exiftool verification are inside the exiftran block. exiftool warnings are thus
never ignored (I think warnings should be loggued, though):
if "exiftran" in cmdline:
if "processing" in outerr:
# exiftran output process in stderr ;-(
outerr=""
if "exiftool" in cmdline:
if "Warning" in outerr:
#exiftool warning that has no impact on result
outerr=""
Original comment by chartier...@gmail.com
on 10 Nov 2010 at 10:06
The proper way is to check exiftran's errorlevel on return. As any other decent
behaving command line utility it returns 0 when processing goes without
problems, and 1 when it doesn't.
Original comment by matej.c...@gmail.com
on 5 Dec 2010 at 1:12
However, status code processing is something which should be incorporated into
the basic jbrout's infrastructure for calling external programs.
Original comment by matej.c...@gmail.com
on 5 Dec 2010 at 1:13
I can only agree, of course.
Original comment by chartier...@gmail.com
on 10 Jan 2011 at 1:06
Do we still need exiftran for rotation once we have issue #129 (commit r335)
has been fixed?
Original comment by matej.c...@gmail.com
on 10 Jul 2011 at 6:11
sure, we should keep it, if we want to keep a "loss-less rotation", AFAIK I've
never seen a python lib which is able to do that.
Original comment by manat...@gmail.com
on 12 Jul 2011 at 9:29
Are you sure?
http://stackoverflow.com/questions/1606587/how-to-use-pil-to-resize-and-apply-ro
tation-exif-information-to-the-file
This answer seems to indicate that pyexiv2 can do it.
Original comment by matej.c...@gmail.com
on 12 Jul 2011 at 9:35
Just making a note for myself. This could be interesting
http://sylvana.net/jpegcrop/exif_orientation.html
Original comment by matej.c...@gmail.com
on 12 Jul 2011 at 11:43
Original comment by matej.c...@gmail.com
on 12 Aug 2013 at 10:25
Original comment by matej.c...@gmail.com
on 12 Aug 2013 at 10:25
Original issue reported on code.google.com by
chartier...@gmail.com
on 6 Nov 2010 at 8:51