[Gimp-developer] Naming of thumbnails in Gimp on Windows....



I'm new here, so Hi all. :)

I just finished a python script/plug-in called GIMP Book for managing
multiple pages in GIMP 2.6 (I make comics in my free time, so it comes
quite handy). It can be found at http://registry.gimp.org/node/25975 I
developed it on Ubuntu, and it works fine on Ubuntu and Fedora, but
fails on Windows.

I've narrowed the Windows problem down to the code that finds the
thumbnails created by Gimp. It looks up the md5 hash of the path to
the image, and then looks for that image in ~/.thumbnails/large or
normal. The same code on Windows returns a hash that doesn't match the
name of the thumbnail generated. For instance:

import urllib
import hashlib
bla = urllib.quote("C:\g.xcf")
hashlib.md5("file://" + bla).hexdigest()

Returns eef9b62......something, but the thumbnail for C:\g.xcf is
called e345adf8ffb47e9a1be0fa35aa457295.png

I'm guessing it is something simple, but all the testing I've done
with escaping characters and different variations has come up short.
So how would I go about getting the correct md5 hash for a Windows
path in Python?

Cheers,

  Ragnar


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]