Implementation of "Time shift action"

Bug #386741 reported by Juho Vepsäläinen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Phatch
Fix Released
Undecided
Juho Vepsäläinen

Bug Description

This patch implements https://blueprints.launchpad.net/phatch/+spec/time-shift-action .

Juho: Note that this action as well as other actions related to metadata seem to modify original input images in any case (ie. even if save action is provided). I'm not convinced this is a good default behavior as it's easy to mess up metadata of your original files easily this way. (Result does not match expectation as Phatch works in non-destructive way with images. :) )

Stani: At the moment the design is that the metadata actions should modify the source image is the metadata action is placed *before* the save action. So this is totally intended at the moment. When it is placed *after* the save action, it will modify only the saved file. See the phatch-dev mailing list. This behavior will change soon to a better approach.

Tags: patch
Revision history for this message
Juho Vepsäläinen (bebraw) wrote :
Revision history for this message
Juho Vepsäläinen (bebraw) wrote :

Note that the patch depends on dateutil module available at http://labix.org/python-dateutil . Perhaps it should be provided with phatch (ie. phatch/other/dateutil)?

Revision history for this message
Juho Vepsäläinen (bebraw) wrote :

The patch is still missing file time part. I will add that shortly.

Revision history for this message
Juho Vepsäläinen (bebraw) wrote :

I added the file time part to the patch. It's not working yet though. I guess the file time set in metadata gets overridden once the file is saved. Any ideas how to sort out this issue? I see the point of having time shift for EXIF but modifying the file modification time seems a bit counterintuitive.

Stani (stani)
description: updated
Revision history for this message
robinmills (robinmills) wrote : Re: [Phatch-dev] [Bug 386741] Re: Implementation of "Time shift action"

Goodness, Stani. Isn't it time for bed?

Good weekend in Belgium? (answer tomorrow). Bed. Now!

Robin
http://clanmills.com

On Jun 14, 2009, at 10:13 PM, stani wrote:

> ** Description changed:
>
> This patch implements https://blueprints.launchpad.net/phatch/+spec
> /time-shift-action .
>
> - Note that this action as well as other actions related to metadata
> seem
> - to modify original input images in any case (ie. even if save
> action is
> - provided). I'm not convinced this is a good default behavior as it's
> - easy to mess up metadata of your original files easily this way.
> (Result
> - does not match expectation as Phatch works in non-destructive way
> with
> - images. :) )
> + Juho: Note that this action as well as other actions related to
> metadata
> + seem to modify original input images in any case (ie. even if save
> + action is provided). I'm not convinced this is a good default
> behavior
> + as it's easy to mess up metadata of your original files easily
> this way.
> + (Result does not match expectation as Phatch works in non-
> destructive
> + way with images. :) )
> +
> + Stani: At the moment the design is that the metadata actions should
> + modify the source image is the metadata action is placed *before*
> the
> + save action. So this is totally intended at the moment. When it is
> + placed *after* the save action, it will modify only the saved
> file. See
> + the phatch-dev mailing list. This behavior will change soon to a
> better
> + approach.
>
> --
> Implementation of "Time shift action"
> https://bugs.launchpad.net/bugs/386741
> You received this bug notification because you are a member of Phatch
> Developers, which is subscribed to Phatch.
>
> Status in Phatch = Photo & Batch!: New
>
> Bug description:
> This patch implements https://blueprints.launchpad.net/phatch/+spec/time-shift-action
> .
>
> Juho: Note that this action as well as other actions related to
> metadata seem to modify original input images in any case (ie. even
> if save action is provided). I'm not convinced this is a good
> default behavior as it's easy to mess up metadata of your original
> files easily this way. (Result does not match expectation as Phatch
> works in non-destructive way with images. :) )
>
> Stani: At the moment the design is that the metadata actions should
> modify the source image is the metadata action is placed *before*
> the save action. So this is totally intended at the moment. When it
> is placed *after* the save action, it will modify only the saved
> file. See the phatch-dev mailing list. This behavior will change
> soon to a better approach.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~phatch-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~phatch-dev
> More help : https://help.launchpad.net/ListHelp

Revision history for this message
Stani (stani) wrote :

Hi Juho,

Please remove the _set_photo_date method() it seems irrelevant. It makes indeed little sense to modify filetime. I remember an user asking for it as he liked to have the exif and file times synchronized. If we want to implement it, we would need to add two extra fields:
- ChoiceField Source: Exif or File
- ChoiceField Target: Both, Exif or File

Moreover we would need to store the datetime in the photo object and modify photo.save it uses it. Maybe this is too much work and we could extend it, when there is a demand for it. So leave it for now, we have more important things to do.

You should have mentioned that you wanted to include a module and put the right copyright information in phatch/copyright:
$ bzr diff copyright
=== modified file 'copyright'
--- copyright 2009-06-11 16:44:23 +0000
+++ copyright 2009-06-15 05:34:58 +0000
@@ -156,6 +156,16 @@
    http://www.python.org/ftp/python/contrib-09-Dec-1999/DataStructures/

+The file phatch/other/relativedelta.py is a source file of dateutil and is
+licensed under its license:
+
+ Copyright (c) 2003-2007 Gustavo Niemeyer <email address hidden>
+
+ This module offers extensions to the standard python 2.3+
+ datetime module.
+
+ PSF License
+
 The file phatch/other/findsystem.py is a source file of TTFQuery-1.0.1 and is
 licensed under its license:

In this case there is no problem as it is compatible with the GPL. It is now added to phatch/other so you can import it with
>>> from relativedelta import relativedelta

Can you please attach an updated fix?

Changed in phatch:
assignee: nobody → Juho Vepsäläinen (bebraw)
status: New → Incomplete
Revision history for this message
Juho Vepsäläinen (bebraw) wrote :

I removed the redundant _set_photo_date method. I must have forgotten it there before I figured out I can use datetime directly. I agree that it's better to implement enhanced functionality at some other time. I suppose "time shift", as it is, manages to be useful to some extent.

Good point about including a module.

It would be good to trigger "Image Inspector" update after executing the action list. (Perhaps do this in any case for time being?) As I am not familiar with the way it works perhaps this is something you could look into (supposed it proves to be easy enough fix :) ).

Revision history for this message
Stani (stani) wrote :

Hi Juho, for the tile action I proposed that Nadia could implement the icon. Now you are so productive, it is better to learn to do it yourself as I don't want to turn Nadia into an icon convertor. So please look for the actions, which you contribute, for a nice shiny, glossy icon which fits with the rest of Phatch. The icon should be compatible with the GPL, so no creative commons! The most easy is to take one from the openclip art library, as they are public domain. As a suggestion, for this action you could you use a chronometer icon or a clock. I'm sure you'll find something ;-) Please also add icons to your previous actions. I'll mark them as incomplete to keep track. Also send a mail to Dwarrel to document your actions, give a bit of info if needed.

For howto on embedding, see (only works with wx2.6, not wx2.8):
python /usr/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/tools/img2py.py highlight_plugin_icon.png icon.py
http://photobatch.wikidot.com/writing-actions

I've committed it to trunk already:
$ bzr commit -m "added time shift action"
Committing to: /home/stani/sync/python/phatch/trunk/
added phatch/actions/time_shift.py
Committed revision 775.

Stani (stani)
Changed in phatch:
status: Incomplete → Fix Committed
Stani (stani)
Changed in phatch:
milestone: none → 0.2.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

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