How to print images?

In Sylpheed Main’s mailing list, it has been asked how to print images attached to a mail. The only answer provided was:

« A workaround is to save the message somewhere with the .eml extension,
so you can open it as Outlook Express message and print from there. »

I guess anyone can see the irony of this. Well, I thought that I wouldn’t want to have to answer this question, so I added images in the prints we do with libgnomeprint.

Print preview

There are a few funny things to implement it, like the fact the x,y coordinates origin is in the lower-left corner like in maths, instead of the upper-left corner like we developers are used to. That, and libgnomeprint prints images, by default, to the 0,0-1,1 coordinates, making a nice 1 pixel image. So one has to rescale the thing explicitely. Still, I like this lib, even if its documentation mainly consists of digging through mailing-list posts to find out an answer provided to someone having the same problem before!