Archives / Search ›

Trying to use PyDS’s PictureTool

George Bauer (who’s been really helpful, thanks!) explained briefly how to use PyDS’s PictureTool in a comment:

Of course PyDS has a PictureTool. You need to enter a path on your disc in the Pictures preferences and then can upload pictures from there. To upload a picture go to the pictures upload area and enter title and description for those pictures you want to upload. After uploading, you can refer to them with \$pictures.imageTag(picid, (sizex, sizey)). Set picid to the numerical id of your picture and sizex,sizey to the boundingbox the resized picture should fit in (resizing honours aspect ratio, so you picture might actually be smaller than your boundinbox).

It seems that the PictureTool is optimized for posting pictures, not screen images; PyDS provides a nice album-style overview page. This is good, and something Radio didn’t even attempt to do, but all I really want is a single image uploaded. The interface looks like this:

I have no idea what the various text fields represent, and I get a Python exception when I try to submit a fully populated form. If I remove entries 2 and 5, nothing seems to happen. Time to dig into the source code.

Turns out QuickTime 6.4 (and earlier?) incorrectly output PNG tEXt chunks including a trailing null, and PIL chokes on them. PyDS discards the error, and behaves strangely.

That fixed, my next problem: still not getting any thumbnails. pyds-start -f will run PyDS in the foreground.

error: Server Error: exceptions.IOError,
encoder jpeg not available:
file: /System/Library/Frameworks/Python.framework/
Versions/2.3/lib/python2.3/site-packages/
PIL/Image.py line: 325

After rebuilding PIL, I ran into another problem with PyDS: once it attempted to create a thumbnail and failed, it’d write a zero-length file and give up. Fixing that, I finally had thumbnails.

No comments yet. Be the first.

Leave a reply