I'm pretty sure that GD can do this... I want to make a stupid Australian "down under" mirror of a site (just the index page), flip it 180, and save it as a JPG. I want to update the image once daily, so that it reflects what is on the 'real' site. Can somebody point me in the right direction?
I want to do a fullsize screen shot (min 800x600 resolution), and have it refreshing from a cron job on my own server.
Not as easy as it seems and it most certainly be easier to get accomplished in other language that not PHP. Keeping it simple. the problem here is how to render the page. I mean, you can extract the contents of the page through a cURL request, but that are just a bunch of ASCII characters. The task of translating those characters into a graphic interface is done by your browser. To my knowledge PHP doesn't have any native library that could emulate such behavior. I'm pretty confident that PHP doesn't even have a GUI library... Anyway here are some pointers: imagegrabscreen() - Only works under Windows and you'll have to somehow trigger your browser to get opened before you take the printscreen. Then you'd have to trim the image so that only the browser would appear. wkhtmltopdf - A much more interesting solution. Uses the webkit engine to render the page. Worth taking a look html2ps Good luck!
Doesn't have to be PHP. I thought that most of those website thumbnail sites would have been running PHP + GD, and I could do the same thing at 100%. --- Any idea on how Google creates the popup cache images for websites? I thought this would be easy!
I already gave you a couple of options. To my knowledge there's no "direct" way of doing what you want to accomplish. It's certainly possible to do, but there's no "magic formula". For instance, if I recall correctly Java Swing components are able to interpret HTML. A solution could be upon request, grab the page's HTML, add it to a JPanel (?) and then create an image from the JPanel contents. I gave you a couple alternatives on my previous posts (pre-built libraries), after digging around a bit more, here are a couple more: ScreenShot - A PHP Class. Again relies on IE to render the image (only works on Windows). dompdf - Apparently is able to render a PDF from HTML html2pdf - Same as above html2image (Java) ACA WebThumb ActiveX (Java) - Again relies on ActiveX controls, therefore only works with Windows Although I highly doubt so, you can stick around to check if someone as an easier solution to this. For what is worth, Id's stick with wkhtmltopdf, seems a solid library and there's already a PHP binding written - https://github.com/mreiferson/php-wkhtmltox. Good luck!
Here's a possible alternative for you to think about: Add this to your css file: Firefox, Chrome, or Opera body { -moz-transform: rotate(-180deg); -o-transform: rotate(-180deg); -webkit-transform: rotate(-180deg); } Code (markup):