phatch does not work with pyexiv2 ≥ 0.2

Bug #585169 reported by Anish Bhatt on 2010-05-24
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Phatch
Critical
Unassigned

Bug Description

phatch fails to work with pyexiv 0.2.1 trace as below :

ERROR 1: Unable to open file: /home/anish/discord/obey_wallpaper_02.jpg:
'module' object has no attribute 'Image'
Image: /home/anish/discord/obey_wallpaper_02.jpg
Action:
None
Details:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/phatch/core/api.py", line 561, in get_photo
    photo = pil.Photo(info_file, info_not_file)
  File "/usr/lib/python2.6/site-packages/phatch/core/pil.py", line 454, in __init__
    layer.image)
  File "/usr/lib/python2.6/site-packages/phatch/core/pil.py", line 177, in __init__
    self.pyexiv2, pyexiv2_temp = exif.read_metadata_temp(path)
  File "/usr/lib/python2.6/site-packages/phatch/lib/_pyexiv2.py", line 265, in read_metadata_temp
    image = pyexiv2.Image(filename)
AttributeError: 'module' object has no attribute 'Image'

Fix might be similar to http://bazaar.launchpad.net/~dlynch3/rapid/trunk/revision/214

robinmills (robinmills) wrote :

pyexiv2 version 0.2 has a different API than previous releases (pyexiv2 0.1.3). So, it cannot be used as a drop-in replacement. We plan to include pyexiv2 0.2 in Phatch 0.30.

Anish Bhatt (anish7) wrote :

archlinux currently only has pyexiv2. I do package maintainance for phatch in archlinux. Can you release a patch atleast so that I can include it and phatch can work on archlinux ?

robinmills (robinmills) wrote :

I'm sorry to say that this isn't a simple thing to do. Our current plan is to complete on 0.28 release (which will include Windows and Mac Installers). Our plan was to face the pyexiv2 issue in 0.3.

Is there a simple alternative? Perhap's it is possible to include the pyexiv2 0.1.3 (and exiv2 0.18.2) shared libraries in a directory which is private to phatch and everybody might be happy.

I've personally never used archlinux, however I'm happy to investigate this possibility, if you think it will work. And of course, I can't commit to this without the agreement of the other members of the team.

Stani (stani) on 2010-05-25
summary: - phatch does not work with latest version of pyexiv2
+ phatch does not work with pyexiv2 0.2

As Robin pointed out, the API of pyexiv 0.2 .* is incompatible with pyexiv 0.1.* Unfortunately this touches the core of Phatch and will need quite some work and testing to update to the latest API.

At the moment we need to finish release 0.2.8 first. If there are no major bugs in this release, we will work on porting Phatch to pyexiv2 0.2 for the next release.

Changed in phatch:
importance: Undecided → Critical
status: New → Confirmed
Anish Bhatt (anish7) wrote :

Could you guys point me to the files pyexiv/exiv shared files that would need to be included ? It might be a hack, but it would get phatch working on arch till you guys update.

Stani (stani) wrote :

@anish

I am not sure if I understand your question, but this is the version Phatch needs:
http://tilloy.net/dev/pyexiv2/releases/pyexiv2-0.1.3.tar.bz2

Russell Harrison (rharrison10) wrote :

The version of pyexiv2 in Fedora is 0.2.2. Has any progress been made on updating the Phatch interface to work with the newer version?

Sadly we haven't made progress with this because the team has been busy making a living!

So ... not done and not forgotten!

Robin

On Dec 6, 2010, at 12:41 PM, Russell Harrison wrote:

> The version of pyexiv2 in Fedora is 0.2.2. Has any progress been made
> on updating the Phatch interface to work with the newer version?
>
> --
> You received this bug notification because you are a member of Phatch
> Launchpad Team, which is subscribed to Phatch.
> https://bugs.launchpad.net/bugs/585169
>
> Title:
> phatch does not work with pyexiv2 0.2
>
> Status in Phatch = Photo & Batch!:
> Confirmed
>
> Bug description:
> phatch fails to work with pyexiv 0.2.1 trace as below :
>
> ERROR 1: Unable to open file: /home/anish/discord/obey_wallpaper_02.jpg:
> 'module' object has no attribute 'Image'
> Image: /home/anish/discord/obey_wallpaper_02.jpg
> Action:
> None
> Details:
> Traceback (most recent call last):
> File "/usr/lib/python2.6/site-packages/phatch/core/api.py", line 561, in get_photo
> photo = pil.Photo(info_file, info_not_file)
> File "/usr/lib/python2.6/site-packages/phatch/core/pil.py", line 454, in __init__
> layer.image)
> File "/usr/lib/python2.6/site-packages/phatch/core/pil.py", line 177, in __init__
> self.pyexiv2, pyexiv2_temp = exif.read_metadata_temp(path)
> File "/usr/lib/python2.6/site-packages/phatch/lib/_pyexiv2.py", line 265, in read_metadata_temp
> image = pyexiv2.Image(filename)
> AttributeError: 'module' object has no attribute 'Image'
>
> Fix might be similar to http://bazaar.launchpad.net/~dlynch3/rapid/trunk/revision/214
>
>

Robin
http://clanmills.com

pyexiv2 0.3.0 was released two weeks ago (https://launchpad.net/pyexiv2/+announcement/7498). Note that this series remains fully backward compatible with its predecessor, the 0.2 series.

I’m particularly interested in pushing this new release to the upcoming version of Ubuntu (11.04), due in April. To do so I’m working on patching packages that depend on it, and that includes phatch. My goal is to patch the trunk and backport to the version released in ubuntu, so that my work can benefit the project directly. Additionally, it should benefit other distributions (including archlinux and fedora).

Changed in phatch:
assignee: nobody → Olivier Tilloy (osomon)
status: Confirmed → In Progress
Olivier Tilloy (osomon) wrote :

Note that my main goal is to port the existing code base to pyexiv2 0.3, and make sure this doesn’t introduce regressions in the existing functionality. Adding new functionality (e.g. activate XMP support) is out-of-scope at the moment, as it would require lots of testing. However switching to pyexiv2 0.3 will naturally make adding XMP support quite easy to write.

Olivier

It's a real bummer that the pyexiv2 0.2 (and later) api is so different from 0.13. I think I can write a new module pyexiv_forphatch to interface with Phatch. I'll fix pyexiv_forphatch to use either the 0.13 or 0.2+.

I'll have to discuss this with Stani.

Robin

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Olivier Tilloy
Sent: Saturday, January 15, 2011 08:11
To: <email address hidden>
Subject: [Bug 585169] Re: phatch does not work with pyexiv2 0.2

Note that my main goal is to port the existing code base to pyexiv2 0.3, and make sure this doesn’t introduce regressions in the existing functionality. Adding new functionality (e.g. activate XMP support) is out-of-scope at the moment, as it would require lots of testing. However switching to pyexiv2 0.3 will naturally make adding XMP support quite easy to write.

--
You received this bug notification because you are a member of Phatch Launchpad Team, which is subscribed to Phatch.
https://bugs.launchpad.net/bugs/585169

Title:
  phatch does not work with pyexiv2 0.2

Status in Phatch = Photo & Batch!:
  In Progress

Bug description:
  phatch fails to work with pyexiv 0.2.1 trace as below :

  ERROR 1: Unable to open file: /home/anish/discord/obey_wallpaper_02.jpg:
  'module' object has no attribute 'Image'
  Image: /home/anish/discord/obey_wallpaper_02.jpg
  Action:
  None
  Details:
  Traceback (most recent call last):
    File "/usr/lib/python2.6/site-packages/phatch/core/api.py", line 561, in get_photo
      photo = pil.Photo(info_file, info_not_file)
    File "/usr/lib/python2.6/site-packages/phatch/core/pil.py", line 454, in __init__
      layer.image)
    File "/usr/lib/python2.6/site-packages/phatch/core/pil.py", line 177, in __init__
      self.pyexiv2, pyexiv2_temp = exif.read_metadata_temp(path)
    File "/usr/lib/python2.6/site-packages/phatch/lib/_pyexiv2.py", line 265, in read_metadata_temp
      image = pyexiv2.Image(filename)
  AttributeError: 'module' object has no attribute 'Image'

  Fix might be similar to
  http://bazaar.launchpad.net/~dlynch3/rapid/trunk/revision/214

From my point of view, it’s a real bummer that the 0.1 series of pyexiv2 is still in use… ;)
A compatibility layer to interface with phatch may be the good answer, but you will probably find it even harder to test and to support.

While digging in phatch’s code, I’m finding quite a few uses of pyexiv2 that can be simplified a great deal by just switching to the new API. You can find my (clumsy and not-working-so-well-at-the-moment) attempt in the branch linked to this bug report.

Stani (stani) wrote :

Olivier, I haven't had time to look yet at your code, but I really appreciate your effort. I'll try to look at it as soon as I can.

I have a strong preference to not have a compatibility layer but to port Phatch to the new pyexiv2 API. Robin, let me try to find some time to look into this. If I am unable, I'll warn you and I can delegate it to you.

Olivier Tilloy (osomon) wrote :

Note: I renamed my branch pyexiv2-0.3, since it’s currently using some of the niceties introduced in version 0.3 (mostly syntactic sugar, no real new feature or anything that would make it hard to adapt to work with 0.2 though).

Olivier Tilloy (osomon) wrote :

The branch linked (lp:~osomon/phatch/pyexiv2-0.3) is now ready to be tested.

The code base has been adapted to pyexiv2’s new API (≥ 0.2) and as an exception uses in one place a syntactic improvement only available in pyexiv2 0.3 (this can easily be adapted to work with 0.2 too).

On top of that, I fixed the edition of IPTC tags that have multiple values in the image inspector (this is not specific to a given version of pyexiv2, it is currently broken in the trunk).

Please note that because of bug #703624, most of the metadata manipulation actions won’t actually work. A patch is attached to this bug report which you will need to apply if you intend to test such actions.

Testing and feedback is welcome!

Olivier Tilloy (osomon) on 2011-01-26
summary: - phatch does not work with pyexiv2 0.2
+ phatch does not work with pyexiv2 ≥ 0.2
Olivier Tilloy (osomon) wrote :

A version of this branch was extracted into a patch against the 0.2.7.1 release of phatch. It made its way to the Natty repositories as phatch 0.2.7.1-1.
The feedback so far is positive, testing is welcome.

Olivier Tilloy (osomon) on 2014-10-24
Changed in phatch:
status: In Progress → Confirmed
assignee: Olivier Tilloy (osomon) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers