no way to losslessly save file after lossless rotate

Bug #764184 reported by Edward Rapier
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Phatch
Incomplete
Undecided
Unassigned

Bug Description

After using the "Lossless JPEG" action to do a lossless autorotate based on exif orientation, there is no way to losslessly save the result. Doing this in IrfanView Thumbnails results in a file size exactly the same as the original (i.e. no loss in quality). With Phatch, I assumed I would not add a Save action after the lossless rotation because this would result in a loss in quality. But running the lossless rotation action by itself results in a file with 0 bytes. So I added a Save metadata action, but that still resulted in a 0 byte file. Adding a Save action gives me an output file that is rotated, but the quality setting in the Save action results is applied to the saved file, with resulting loss.

The attached tar.gz file contains the input jpeg file, the two action files, and the jpeg files that results from the actions.

Revision history for this message
Edward Rapier (edwardcrapier) wrote :
Revision history for this message
Stani (stani) wrote :

You should use the action "Save Tags" instead of "Save".

Changed in phatch:
status: New → Invalid
Revision history for this message
Edward Rapier (edwardcrapier) wrote : RE: [Bug 764184] Re: no way to losslessly save file after lossless rotate

Then can you tell me what I am doing wrong? I tried "Save Tags" months ago before I posted in the forum and filed the bug report, and I tried it again now but it still is not working for me. I've tried using "Save Tags" pointed to the source folder and to a different folder but I get the same thing - an error message and the original image jpg file changed to a 0 kb jpg file. Using "Save" works just fine, but it is not lossless. Attached are screenshots of my action and the error message. Following is the log:

Error 0:Can not apply action Save Tags on image 'P8071777.JPG' in folder:
/home/edward/Pictures/Trial

local variable 'warnings' referenced before assignment

Action:{'fields': {'File Name': u'<filename>',
            'In': u'/home/edward/Pictures/Trial',
            '__enabled__': 'yes'},
 'label': 'Save Tags'}

Traceback (most recent call last):
  File "/usr/share/phatch/phatch/core/api.py", line 614, in apply_action_to_photo
    photo = action.apply(photo, read_only_settings, cache)
  File "/usr/share/phatch/phatch/actions/save_metadata.py", line 47, in apply
    info.save(filename)
  File "/usr/share/phatch/phatch/core/pil.py", line 440, in save
    return warnings
UnboundLocalError: local variable 'warnings' referenced before assignment

Thanks

Ed

> Date: Fri, 19 Aug 2011 00:31:16 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 764184] Re: no way to losslessly save file after lossless rotate
>
> You should use the action "Save Tags" instead of "Save".
>
> ** Changed in: phatch
> Status: New => Invalid
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/764184
>
> Title:
> no way to losslessly save file after lossless rotate
>
> Status in Phatch = Photo & Batch!:
> Invalid
>
> Bug description:
> After using the "Lossless JPEG" action to do a lossless autorotate
> based on exif orientation, there is no way to losslessly save the
> result. Doing this in IrfanView Thumbnails results in a file size
> exactly the same as the original (i.e. no loss in quality). With
> Phatch, I assumed I would not add a Save action after the lossless
> rotation because this would result in a loss in quality. But running
> the lossless rotation action by itself results in a file with 0 bytes.
> So I added a Save metadata action, but that still resulted in a 0 byte
> file. Adding a Save action gives me an output file that is rotated,
> but the quality setting in the Save action results is applied to the
> saved file, with resulting loss.
>
> The attached tar.gz file contains the input jpeg file, the two action
> files, and the jpeg files that results from the actions.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/phatch/+bug/764184/+subscriptions

Revision history for this message
Stani (stani) wrote :

Please attach instead a zip file with your action list and an example image so we can reproduce your issue. Thanks!

Changed in phatch:
status: Invalid → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.