Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue May 4, 2015 · 10 comments
Open

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 6 Nov 2010 at 8:51

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 10 Nov 2010 at 10:06

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 5 Dec 2010 at 1:12

@GoogleCodeExporter
Copy link
Author

However, status code processing is something which should be incorporated into 
the basic jbrout's infrastructure for calling external programs.

Original comment by [email protected] on 5 Dec 2010 at 1:13

@GoogleCodeExporter
Copy link
Author

I can only agree, of course.

Original comment by [email protected] on 10 Jan 2011 at 1:06

@GoogleCodeExporter
Copy link
Author

Do we still need exiftran for rotation once we have issue #129 (commit r335) 
has been fixed?

Original comment by [email protected] on 10 Jul 2011 at 6:11

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 12 Jul 2011 at 9:29

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 12 Jul 2011 at 9:35

@GoogleCodeExporter
Copy link
Author

Just making a note for myself. This could be interesting

http://sylvana.net/jpegcrop/exif_orientation.html

Original comment by [email protected] on 12 Jul 2011 at 11:43

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 12 Aug 2013 at 10:25

  • Changed title: *Get finally rid off exiftran *

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 12 Aug 2013 at 10:25

  • Changed title: Get finally rid off exiftran (loss-less rotation in Python)
  • Changed state: Accepted
  • Added labels: Component-jbrout, Priority-Medium, Type-Enhancement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant