Web Page Thumbnails
Matt Biddulph wrote a nice little hack to create a thumbnail of any URL using Mozilla and Python. In awe of the coolness this could give, I grabbed it and had a quick play. Matt and myself both spotted the deliberate error he introduced in the script he uploaded, then I replaced the usage of PIL with GDK (thus doing the rescale in memory without going to disk), and fiddle the size of the thumbnail. Et volia:
There are still issues: sadly Mozilla won't render the page to a window without the window being visible on screen. Maybe a lower-level API would allow this, but for now it does the the job rather well. Well done Matt. My hacked copy is available here.
NP: Liquid Swords, GZA.
http://www.xfree86.org/4.0.1/Xvfb.1.html
If you were using Keith's X server, you could use the Composite extension to redirect the contents of the mozilla widget's window heirarchy.
I doubt you'd have much luck replacing the widget's window with a pixmap though this won't help if the widget makes use of subwindows.
Looks very cool. Eye-candish (is that a word?), but also possibly useful.
Any change of it making it into Nautilus 2.7 anytime soon?
Also, does anybody know how to re-enable the old style MIME sniffing in Nautilus 2.6 without a recompile.
Finally, any way to get text file preview in the icons in nautilus, like in KDE?
Thanks,
Victor
A big, big, THANK YOU! I was pulling my hair for two days and nights, without any luck, looking for a solution, when I found this page. Tremendously useful tool! I'm using it running headless (Xvfb), for pushing URL thumbnails to a J2ME application.
Thank you for making this available.
Andrzej
Excellent work, thanks.
I had to make a couple of changes to get it working in Fedora.
yum install gnome-python2-gtkmozembed to get the GTK/Python/Moz stuff.
This installs the python module, but it's called "gtkmozembed", not "gtkmoz" so you need to replace this throughout the script.
Dan
Found your site here: http://www.hackdiary.com/archives/000055.html,
which was linked to from here:
http://dev.upian.com/hotlinks/
I'm using Magpie now to display an Atom feed, but like Hotlink, would like to display a screenshot (Francois, of that site, doesn't seem to be in best mood replying to my request...).
Is there a package\one time install of your 'program'? I do know some coding, but installing server add ons etc is too much asked of me.
Or where I can a more detailed explanation - as I have to ask my host to set it up.
If not possible, are there any alternatives?
Battling now for days ;-(
Thanks in advance!
How\where did you get the required calculation script? It's really clever and much easier to implement than http://captchas.net/ (which is very good in itself).
Thanks!
- Replace references of "gtkmoz" with "gtkmozembed"
- Export LD_LIBRARY_PATH=/path/to/your/mozilla/installation
- Run the script
I had 3 versions of libgtkembedmoz.so:
- One that I compiled myself from the Firefox 2.0.0.4 source code and didn't seem to work
- One from Firefox 1.5.0.1 installed from yum repositories that failed in a point different from my compiled version
- The Mozilla 1.7.12, also from yum repositories, which worked perfectly.
I have no idea why such incompatibility between libraries (maybe I can understand mine, but what about both builds from repositories?), so if anyone has a clue, please post back.
I should try this soon on a Fedora Core 7 installation, and at my Ubuntu Feisty at home and see what happens. I'll report back any findings :-)
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/26436/comments/47
My main additions are the automatic launching of a VNC server, for headless / batch usage, and a guardian process to kill the main process after a timeout, so that the script won't wait forever in the case of network problems or other nuisances.
I have also written a helper script to call many instances of my main script in parallel, reusing the VNC servers, for maximum speed in thumbnail creation.
http://www.gruppo4.com/~tobia/pythumbnail.shtml
works for me
related link: https://bugs.launchpad.net/firefox/+bug/26436