Michal Čihař - Blog Archives for Coding

Real address in bug tracker makes sense!

Today, when walking through some Wammu/Gammu bugs, I came to conclusion that the spam changed some people to behave insane. The email field in bug tracker is there to allow developer to contact you, for example when he makes a fix for issue you reported and wants you to test it. Entering addresses as ones at TrashMail which will vanish soon (the bug I'm talking about is two days old, what I feel is good enough reaction time from my side), will not help anybody.

Thank you firebird76 (whatever your real name is) for realizing how people are stupid.

PS: I use Mantis bug tracker, which I believe does not expose email addresses to anyone besides privileged users.

Photo uploader 0.4

Good news everyone, new version of Photo uploader has been just released. If you don't know this tool yet, it is helper to upload photos (or images) over net. It was created when I became too lazy to upload hundreds of photos to digilab, but generally it can support any service which allows you uploading of whatever using HTML forms.

News in this release:

  • Fixed crash.
  • Added uloz.to service.

Photo uploader 0.3

Good new everyone, new version of Photo uploader has been just born. If you don't know this tool yet, it is helper to upload photos (or images) over net. It was created when I became too lazy to upload hundreds of photos to digilab, but generally it can support any service which allows you uploading of whatever using HTML forms.

News in this release:

  • It is possible to get session ID from API.
  • Added support for opening in user defined browser.
  • Now parses ~/.photo-upload and uses it as defaults.
  • Support for uploading to imageshack.us.

Dictionary snapshots in more incarnations

On request I just added three new incarnations of dictionary snapshots. So if you're using display not capable of utf-8, you can use ascii variant, for those using non-Debian sdcv, notags variant has been created (but I anyway recommend you to apply patch to add Pango markup support). And finally there is combined super-crippled ascii-notags version :-).

SCons is next-generation build tool?

You can read following text on SCons homepage:

SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software.

Then they list tons of features. But why the hell it does not support DESTDIR like functionality out of the box? While googling for this I found that most projects add the same code to handle this feature that will be used by almost every Linux distribution. I think such feature should be built in into next-generation build tool.

PS: If you're asking what would I use, it is simple - for Python just use distutils, they do what you need, for rest I can recommend CMake.

PS2: I just need to express my disappointment after packaging pyexiv2 which uses scons.

Exiv2 support for Pentax maker notes

As I have Pentax camera, I wanted to be able to extract information from maker notes it stores to EXIF. As only tool which seems to be capable of this is ExifTool and it is a Perl beast which I really don't want to use from Python, I need to add support for it to some existing library.

I found two which could be used - libexif and Exiv2. Because of availability of Python bindings I choose Exiv2. The reason why I also prefer this is upcoming XMP support for which I was looking recently. The only disadvantage I can see is that libexif is more widely used by applications. Why the hell couldn't be just one library doing this?

Anyway if you're interested in Pentax maker note support for Exiv2, you can find it in their bug tracker and it will hopefully appear soon in their svn ;-).

First success with Photo uploader

Today I did really big stress testing of Photo uploader - I needed to upload 400 photos (total size somewhere near 600 MiB). And it worked without problems! I could not imagine that I would have to upload so much files using web forms or some damn slow Windows application.

Also since last announcement uploader development went on. It now supports 4 services (all in Czechia for now), I added some documentation and man page. Also version 0.1 has been released yesterday (but it does not yet contain mentioned updates), with plan to release 0.2 somewhere next week.

And as I got quite a lot of requests for GUI - I do not plan to write one myself (or at least not soon). So if you want one, please write it. As all hard work is done by phoupl module, it can be easily embedded into some simple image viewer written in Python.

Uploading photos to minilab

I was looking for some easier solution than using web forms, but no minilab seems to support Linux here. Windows applications I tried so far does not seem to work in Wine, so this is also not an option. Only thing that seems to work is Picassa, but it is quite big tool to make just uploading photos and it is anyway some beast using Wine.

So the only option was to write something myself. Using cURL from Python is quite easy so I hacked simple script to upload photos to minilab using PycURL. It currently supports only Droxi, but it might be later extended to support others. The code is also now a bit fragile as it does almost none error checking, but I was able to upload first set of photos to minilab and continue order in browser.

You can download my proof of concept code at Photo uploader page, but don't expect anything clever from it, but it should basically work :-).

XMP support for Python

As I produce quite a lot of photos and want to manage them in some reasonable way, I started to look for some tools which can do commenting/tagging/whatever of taken photos. I really don't want these meta data stored outside picture itself, so most of photo managers currently available are not acceptable. When reading Gnome 2.20, I noticed support for XMP (Extensible Metadata Platform) in eog.

Well I didn't know this standard up to now, but it looks interesting. Especially when open source tools can easily adopt library open sourced by Adobe. I would like to add support for this to Lazygal, but I didn't find any reasonable Python module to work with XMP. There is simple extractor, but nothing what would allow me to easily grab meta data out of file. In fact one solution seems to exist, but it costs almost $300 and is not free software in any way.

Or did I just miss something when using Google and some such Python library exists?