peircej / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

Get finally rid off exiftran (loss-less rotation in Python) #176

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add pictures in jbrout from a filesystem where you don't have full rights 
(in my case a vfat filesystem mounted as root)
2. Try to rotate/autorotate pictures
3.

What is the expected output? What do you see instead?
The progression bar moves fairly quickly, but nothing else happens. No error on 
screen if jbrout was started from command line. 
I expect there whshould be a warning that things went wrong.

What version of the product are you using? On what operating system?
SVN R316 on linux ubuntu 10.04 LTS

Please provide any additional information below.
I did a quick test with exiftran and it complains that it cannot do a chmod (or 
chown, I'm not sure) on the file.

Original issue reported on code.google.com by chartier...@gmail.com on 6 Nov 2010 at 8:51

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
I can only agree, of course.

Original comment by chartier...@gmail.com on 10 Jan 2011 at 1:06

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago

Original comment by matej.c...@gmail.com on 12 Aug 2013 at 10:25

GoogleCodeExporter commented 8 years ago

Original comment by matej.c...@gmail.com on 12 Aug 2013 at 10:25