iPod Photo support, preferences, and not just JPEGs anymore

I have just released GPixPod 0.3 on SF with these new features:

  • Now iPod Photo seems supported fine (probably iPod Color, too)
  • All gdk-pixbuf image formats now supported for photo import. Thus in addition to JPEGs, now also PNGs, BMPs, GIFs, SVGs…
  • Preferences dialog: automatic detection/opening, mountpoint, etc.
  • Refined image conversion functions to keep ratio when scaling
  • Added basic image conversion functions to rotate CCW and CW

30 Responses to “iPod Photo support, preferences, and not just JPEGs anymore”

  1. A.Slocum Says:

    Really nice to have a ipod app for linux transfer of photos!
    But i have one bug: 3/4 photos are ok but for me but all of the 4/3 photos are not scaled down. my ipod video shows them full size (or better: just a part of them) and after the first 4/3 photo all screwed up because of the scaling. all photos were 5-6MPix from a digicam pre-rotated. i tried to add them one by one but its the same. i have no error when starting from the commandline (ubuntu)

  2. A.Slocum Says:

    just one addition: i just downloaded the 0.2.2 for test… it works. but still not with 0.3. but 0.2.2 stretched the 3/4 to 4/3 ;)

  3. Ian Says:

    Anybody know how to actually get this to work without a tonne of Python callbacks?

    Most seem inoquous, but the killer comes when saving:

    Traceback (most recent call last):
    File “./gpixpod.py”, line 254, in Save
    self.DB.AddPhoto(*self.photos_to_add[x])
    File “/home/imorgan/GPixPod-0.3/mh.py”, line 483, in AddPhoto
    photo_id = self._AddPhotoToList(filename)
    File “/home/imorgan/GPixPod-0.3/mh.py”, line 402, in _AddPhotoToList
    self._AddPhotoThumbs(filename, photo_id)
    File “/home/imorgan/GPixPod-0.3/mh.py”, line 363, in _AddPhotoThumbs
    imgdata = toInterlacedUYVY(filename)
    File “/home/imorgan/GPixPod-0.3/imgconvs.py”, line 201, in toInterlacedUYVY
    pixbuf = pixbuf.composite_color_simple(720, 480, gtk.gdk.INTERP_TILES, 255, 2160, 0, 0)
    TypeError: GdkPixbuf.composite_color_simple() argument 6 must be long, not int

    This hangs GPixPod (it’s status just says ‘Adding photos…’ forever).

    Other usability things, varying from nuisance to god-awful:

    1) When adding an album, accept Return to complete the dialog, rather than having to click the OK button.

    2) Allow adding more than one picture at a time! I want to add a whole directory of photos. Adding hundreds of photos one at a time is rediculous, _especially_ given #3 below.

    3) To make things much much worse, when adding successive photos, the file dialog reverts back to the same initial directory each time, forcing the user to re-navigate to the photos over and over and over again. Extremely annoying and time consuming, but would be highly mitigated by fixing #2.

  4. Ian Says:

    File “/usr/local/GPixPod/imgconvs.py”, line 201, in toInterlacedUYVY
    pixbuf = pixbuf.composite_color_simple(720, 480, gtk.gdk.INTERP_TILES, 255, 2160, 0, 0)
    TypeError: GdkPixbuf.composite_color_simple() argument 6 must be long, not int

    Maybe fixed by changing the “0″’s to “long(0)”’s.

    But now instead of crashing, it just chews 100% cpu when saving.. several minutes have gone to add one single photo. Not good. Any ideas?

  5. Ian Says:

    Exact same failures on FC2 and Centos 4.

  6. flagar Says:

    Hi all,
    thanks for your interest in GPixPod!
    Slocum: please explain me better: do you get the problem only when scaling down the pictures of your camera, or with any kind of picture (e.g. a wallpaper?)
    Ian: I have just got the same error in GdkPixbuf.composite_color_simple() today when trying a Win32 port. I’m currently investigating it. It would be very helpful to know the versions of your apps (python, gtk, pygtk).
    About adding multiple photos: it is possible, just keep CTRL or SHIFT pressed while selecting in the file chooser. I will address the current directory problem and your other usability suggestions in the next 0.3.1 release.
    Flavio

  7. A.Slocum Says:

    did you understand what i mean…? my english is not so good. dont know the word for 4/3.. i mean when a pic is wider than high (4-3 format) then ist NOT scaled down and the pod shows only a fullsize area of that image. all pics after that first are screwed up.
    i can make a pic for you if you want to see the effect and mail it to you.

    i tried with some “normal” pictures/wallpapers. seems fine so far.
    i also tried to convert my photos to .png and resized them before by 50% .. its the same :(
    these are normal .jpgs. maybe something with the exif info? edit: no nothing with the exif.. i removed the exif infos from some files but still the same.
    if it helps. the pics are 2048×1536 / 1536×2048 (ratio 1,3333)
    i also can send you one from these pictures if you want.

    one feature request:
    dont know if its possible with glade to create a open file dialog with preview (dont find that in glade-2 on my own) …but when: pls make one!
    digicam pics are normaly something like DSCNXXXX.jpg from 1000-13374 whatever… to find a specific file i always must oben nautilus and browse to that folder so i can see the preview and the name

  8. Ian Says:

    Re: using CTRL and SHIFT… That was the first obvious thing I tried and I only mentioned the problem because that doesn’t work. Perhaps a different GTK default?

    On the FC2 box (with a mix of FC3 and EL4 stuff too):
    python-2.3.4
    gtk2-2.6.7
    pygtk2-2.4.1

    On the Centos 4 box:
    python-2.3.4
    gtk2-2.4.13
    pygtk2-2.4.0

  9. Ian Says:

    Found the multi-select “bug”:

    — gpixpod.glade~ 2006-02-16 16:38:32.000000000 -0500
    +++ gpixpod.glade 2006-02-16 16:38:32.000000000 -0500
    @@ -658,7 +657,7 @@
    True
    GTK_FILE_CHOOSER_ACTION_OPEN
    True
    - False
    + True
    False
    False
    Choose File - GPixPod

  10. Ian Says:

    arg damned sting stripped the ‘tags’…

    — gpixpod.glade~ 2006-02-16 16:38:32.000000000 -0500
    +++ gpixpod.glade 2006-02-16 16:38:32.000000000 -0500
    @@ -658,7 +657,7 @@
    <property name=”visible”>True</property>
    <property name=”action”>GTK_FILE_CHOOSER_ACTION_OPEN</property>
    <property name=”local_only”>True</property>
    - <property name=”select_multiple”>False</property>
    + <property name=”select_multiple”>True</property>
    <property name=”show_hidden”>False</property>
    <property name=”do_overwrite_confirmation”>False</property>
    <property name=”title” translatable=”yes”>Choose File - GPixPod</property&g

  11. Ian Says:

    Wow.. ok. I added some debugging to toInterlacedUYVY(). Seems it really is doing something, just REALLY slowly! On the order of several minutes for a single image. This time I’ll wait until one image is complete and see what happens..

  12. flagar Says:

    No, the glade file should remain the same because I use the same implementation of the file chooser also for choosing the Photo Database file, and in that case the selection should remain single.
    I’ve modified the following function in gpixpod.py: the only change is self.filechooser.set_select_multiple(True) after filter.add_pixbuf_formats(). Please try this change (attention at the indentation!) and let me know if now works, so I put in the 0.3.1.
    Here is the whole body of that function:

    def ShowChooser(self, widget, ok_function, filter_name=None, pattern=None, multiple=False, chooser_type=None, title=None):
    """ Show file chooser, to select and open file based on the pattern specified, passing to the specified function """
    self.chooser_callbacks = {'on_button1_clicked':self.DestroyChooser, 'on_button2_clicked':ok_function}
    self.chooser = gtk.glade.XML('gpixpod.glade', 'filechooserdialog1')
    self.chooser.signal_autoconnect(self.chooser_callbacks)
    self.filechooser = self.chooser.get_widget('filechooserdialog1')
    self.filechooser.set_select_multiple(multiple)
    if filter_name != None and pattern != None:
    filter = gtk.FileFilter()
    filter.set_name(filter_name)
    if pattern == 'PIXBUF':
    filter.add_pixbuf_formats()
    self.filechooser.set_select_multiple(True)
    else:
    filter.add_pattern(pattern)
    self.filechooser.add_filter(filter)
    if chooser_type != None:
    self.filechooser.set_action(chooser_type)
    if title != None:
    self.filechooser.set_title(title)
  13. A.Slocum Says:

    maybe its better if you two get together in a irc chat ;)

  14. A.Slocum Says:

    btw… adding multiple photos always works for me.. just shift+click..

  15. flagar Says:

    Please use python 2.4! Some people have reported unknown errors using python 2.3, disappeared when using python 2.4.
    I will specify clearly python 2.4 in the next release. Also debian has python 2.3 as default, so I should call python2.4 explicitly.

  16. flagar Says:

    Ian, now I have seen your packages are too old! Minimum is GTK 2.6 and PyGTK 2.6 and at this point python 2.4. You should really upgrade, if you can.

  17. flagar Says:

    On my Pentium M 1.6Ghz toInterlaceUYVY() takes a fraction of second, and a few seconds the complete process of one 5 megapixel photo.

  18. flagar Says:

    Slocum, I will add the preview in the file chooser. It is really really needed. I do the same like you, I currently open Nautilus, remember the filename and then import in GPixPod. :-( It’s bad, I know so the priority was to get the basics working, but maybe also with the next release I will add this preview, finally. ;-)

  19. flagar Says:

    About the 4/3 problem: sounds very very strange.
    Wallpapers usually have the same ratio, I really don’t understand why the camera pictures are not scaled.
    I thought me too about EXIF tags but if they aren’t the problem… seems misterious… check the command line output and the versions of your libraries…

  20. Paul Harris Says:

    Flavio,

    I can get the app to work on my box when i add the following line at the end of the ipodhal.py script:

    gobject.type_register(iPodHal)

    I am not a python expert so i don’t know why it only works for me with this line but i’d be interested to know what you think.

    THanks
    Paul

  21. Paul Harris Says:

    I am now getting this message when i mount my ipod:

    Traceback (most recent call last):
    File “/home/squarris/dev/ipod/GPixPod-0.3/ipodhal.py”, line 64, in __volume_mounted_cb
    device_dbus_obj = self.bus.get_object(”org.freedesktop.Hal” ,device_udi)
    File “/usr/lib/python2.4/site-packages/dbus/_dbus.py”, line 145, in get_object
    return self.ProxyObjectClass(self, named_service, object_path)
    File “/usr/lib/python2.4/site-packages/dbus/proxies.py”, line 120, in __init__
    (result, self._pending_introspect) = self._Introspect()
    File “/usr/lib/python2.4/site-packages/dbus/proxies.py”, line 132, in _Introspect
    message = dbus_bindings.MethodCall(self._object_path, ‘org.freedesktop.DBus.Introspectable’, ‘Introspect’)
    File “dbus_bindings.pyx”, line 1630, in dbus_bindings.MethodCall.__init__
    File “dbus_bindings.pyx”, line 1443, in dbus_bindings.Message.__init__
    TypeError: expected string or Unicode object, NoneType found

    I think the device_udi returning from this call:

    device_udi = volume.get_hal_udi()

    Is set to null for some reason… any help would be great:

    I am using:

    ii python2.4 2.4.2-2 An interactive high-level object-oriented la
    ii python2.4-dbus 0.60-5 simple interprocess messaging system (Python
    ii python2.4-glade2 2.6.3-2 GTK+ bindings: Glade support
    ii python2.4-gnome2 2.10.0-4 Python bindings for the GNOME desktop enviro
    ii python2.4-gnome2-extras 2.12.1-2.1 Python bindings for the GNOME desktop enviro
    ii python2.4-gtk2 2.6.3-2 Python bindings for the GTK+ widget set

    Thanks a lot …
    Paul

  22. A.Slocum Says:

    Python 2.4.2
    python2.4-gtk2 Version 2.8.4-0
    libgtk2.0.0 Version 2.8.11

  23. Paul Harris Says:

    Ahh - i’ll wait for testing to include the latest gtk libs then!

    Thanks,
    Paul

  24. flagar Says:

    Paul,
    I have just contacted Abaakouk Mehdi who contributed the iPod HAL autodetection script for GPixPod. He answered to me:

    Hi,
    paul need the gobject.type_regsiter() because it use pygtk 2.6
    since pygtk 2.8 gobject.type_regsiter() is deprecated, the gobject
    subclass are automatictly register
    I have no way to detect what version of pygtk is installed (If you found
    one i'am interested)
    
    You can see the changelog of pygtk 2.8 at :
    http://live.gnome.org/PyGTK/WhatsNew28
    /(...)Now GObject's are better integrated into python. For one thing, it
    is no longer needed to call gobject.type_register(MyClass) on
    subclasses, ever; this is now done automatically, through the use of
    metaclasses. Programs still using gobject.type_register will continue to
    work, but receive a deprecation warning.(...) /
    
    For now you can add the "gobject.type_register()" if you want support
    pygtk <=2.6
    
  25. flagar Says:

    Paul,
    for now please upgrade to GTK/PyGTK 2.8 and please tell me if everything works with the original unmodified python code. In the meanwhile I try to support properly even PyGTK 2.6 - as I thought it was.
    Flavio

  26. pugpuppy Says:

    Just installed SuSE 10.0 and works like a charm… and with the iPod Nano. I have had no errors or odd behaviour.

    Great app.

  27. Ian Says:

    Where can I find GTK/PyGTK 2.8 for either FC2 or FC3 or CentOS 4?

  28. Ian Says:

    Oh, and by the way, 0.3.1 did work with my older GTK and Python, but a single small image (186×300) took over 30 minutes to convert on my 2.4GHz P4. It did finally add it to the iPod properly and I was able to view it fine.

  29. Ian Says:

    OK, I found a SRC RPM for python2.4 for FC3 and rebuilt that on my box. Now the toInterlacedUYVY takes about 10 seconds instead of 20+ minuted on python2.3. Much better!
    I didn’t bother with GTK 2.8 because that would just be a nightmare and a half..

  30. flagar Says:

    OK Ian,
    good to know that you was able even with older dependencies, but 30 minutes for an image it is a century! You had such a patience!
    It has been really worth upgrading!!! ;-)

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image