Discovering image dimensions

Jeff Waugh jdub at perkypants.org
Fri Mar 3 12:17:44 EST 2006


<quote who="Travis Reitter">

> If a large page (like Planet GNOME) has a handful of images in some of the
> top posts, and you scroll down to read another post, what you're trying to
> read can keep getting bumped down if the images do not have set <img>
> dimensions.
> 
> Of course, it's "the blogger's fault" for not setting the image
> attributes, but I think it'd be handy if Planet Planet detected (via
> ImageMagick - there are Python bindings) image dimensions, and set them
> within each feed (if they don't already exist).
> 
> Maybe this wouldn't be a default (to not increase minimum dependencies),
> but it'd be a nice option.

You could make it an optional dependency, perhaps trying PIL, ImageMagick or
gdkpixbuf (in pygtk) in some sensible order.

But given that it would have to download the images to get the sizes, and do
some basic caching so it didn't suck down the images every update, and store
all of this stuff, I think it would have to involve a switch.

Not quite something you could do in feedparser itself though, because of all
this mess.

- Jeff

-- 
GUADEC 2006: Vilanova i la Geltrú, Spain            http://2006.guadec.org/
 
                W.O.R.K: Weekend Over, Resume the Killings.


More information about the devel mailing list