RevBrowser - snapshots: not good.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
RevBrowser - snapshots: not good.
Hello,
One of the reasons for trying the latest LiveCode trail was to test a product idea.
A vital part of the test was to see how the RevBrowser object handled snapshots to generate a thumbnail of the webpage.
I have tried the browser demo stack and found that the snapshots were poor. On simple web pages (Google) is had black gaps (between HTML elements I think) in the snapshot. Most other webs sites did not render at all in the snapshot, in fact the snapshot image was blank - black on most of them. On some sites, the snapshot rendered to the colour of the web page, but had no other content.
I put my own stack together using code from the example and from research using the dictionary. I replicated all of the problems above. I don't think this is an "imageData" problem - I was careful to honour the "rect" requirements as noted in the RevBrowser demo stack.
I really need every web page snapshot to be spot on correct.
I am using Windows XP, SP3 and the latest version of LiveCode. However, my interest is in the Mac platform, but I am not in a position to test on that platform at the moment. If it worked 100% on the Mac then that would be wonderful!
Has anyone had success with this? Any help/advice welcome!!
Kind Regards, David.
One of the reasons for trying the latest LiveCode trail was to test a product idea.
A vital part of the test was to see how the RevBrowser object handled snapshots to generate a thumbnail of the webpage.
I have tried the browser demo stack and found that the snapshots were poor. On simple web pages (Google) is had black gaps (between HTML elements I think) in the snapshot. Most other webs sites did not render at all in the snapshot, in fact the snapshot image was blank - black on most of them. On some sites, the snapshot rendered to the colour of the web page, but had no other content.
I put my own stack together using code from the example and from research using the dictionary. I replicated all of the problems above. I don't think this is an "imageData" problem - I was careful to honour the "rect" requirements as noted in the RevBrowser demo stack.
I really need every web page snapshot to be spot on correct.
I am using Windows XP, SP3 and the latest version of LiveCode. However, my interest is in the Mac platform, but I am not in a position to test on that platform at the moment. If it worked 100% on the Mac then that would be wonderful!
Has anyone had success with this? Any help/advice welcome!!
Kind Regards, David.
Re: RevBrowser - snapshots: not good.
What code were you using to display the images? I ran in to an issue where setting the imageData property of an image control would display a corrupted image, but setting the text property would display the proper image.
see if that works for you
Code: Select all
local tSnapshot
revBrowserSnapshot sBrowserId, "tSnapshot"
set the text of image "Browser Thumbnail" to tSnapshot
Re: RevBrowser - snapshots: not good.
Hi David,
I never got the example to work either. I am on a Mac. I changed to take the snapshots from the global coordinates of the browser and that works.
I append a little stack that does take snapshots. Have a look at it. It came out of a discussion on this forum:
http://forums.runrev.com/phpBB2/viewtop ... ser#p27229
it covers some more aspects but you can just take the snapshot part.
Just follow the three steps indicated by -> 1, ->2, ->3. The important part is to initialize the browser first. Then go to a URL. etc.
regards
Bernd
I never got the example to work either. I am on a Mac. I changed to take the snapshots from the global coordinates of the browser and that works.
I append a little stack that does take snapshots. Have a look at it. It came out of a discussion on this forum:
http://forums.runrev.com/phpBB2/viewtop ... ser#p27229
it covers some more aspects but you can just take the snapshot part.
Just follow the three steps indicated by -> 1, ->2, ->3. The important part is to initialize the browser first. Then go to a URL. etc.
regards
Bernd
- Attachments
-
- SnapFromBrowser-3.livecode.zip
- (3.36 KiB) Downloaded 348 times
Re: RevBrowser - snapshots: not good.
Hi all,
yep, the "Browser example" form the Rev examples does not work.
And Bernds solution works wonderfull
Someone already bugreported this?
yep, the "Browser example" form the Rev examples does not work.
And Bernds solution works wonderfull

Someone already bugreported this?
Re: RevBrowser - snapshots: not good.
Hi Klaus,
thank you.
I did not report it because I never found out why it did not work. There must be a pixel off in the coordinates. That is what makes the stripes when you set the imageData. I tried a couple of variations but it did not work.
regards
Bernd
thank you.
I did not report it because I never found out why it did not work. There must be a pixel off in the coordinates. That is what makes the stripes when you set the imageData. I tried a couple of variations but it did not work.
regards
Bernd
Re: RevBrowser - snapshots: not good.
Hi Bernd,
you should bug report it nevertheless including your workaround!
The examples MUST work, it is hard enough for newcomers to get a grip of LC.
Know what I mean?
I don't want to know how many new users have been pissed and quit LC after something did not work as advertised...
Best
Klaus
you should bug report it nevertheless including your workaround!
The examples MUST work, it is hard enough for newcomers to get a grip of LC.
Know what I mean?
I don't want to know how many new users have been pissed and quit LC after something did not work as advertised...
Best
Klaus
Re: RevBrowser - snapshots: not good.
Hi Klaus,
OK, I will.
I remember well how I was clueless to what happened when I first tried the snapshot-browser example.
As it turns out it was reported as bug #4967. I added a comment to that report.
regards
Bernd
OK, I will.
I remember well how I was clueless to what happened when I first tried the snapshot-browser example.
As it turns out it was reported as bug #4967. I added a comment to that report.
regards
Bernd
Re: RevBrowser - snapshots: not good.
There is a lot wrong with snapshots:
- multiple monitors not supported
- RLE paintCompression doesn't work
- size/dimension limits
- PICT format is often converted badly (but this is not extremely important anymore)
- taking snapshots is extremely slow (but this might have to do with memory management problems)
- making snapshots while talking to sockets consistently crashes after ±700 times (number depending on hardware)
- snapshots of child windows (QT, browser) often have bad quality and are sometimes impossible
Having said this, David, you might use a command line utility to create snapshots of a website directly. Just use your favorite search engine and you will fine a few. If this is for a commercial project, I might make something for you.
Kind regards,
Mark
- multiple monitors not supported
- RLE paintCompression doesn't work
- size/dimension limits
- PICT format is often converted badly (but this is not extremely important anymore)
- taking snapshots is extremely slow (but this might have to do with memory management problems)
- making snapshots while talking to sockets consistently crashes after ±700 times (number depending on hardware)
- snapshots of child windows (QT, browser) often have bad quality and are sometimes impossible
Having said this, David, you might use a command line utility to create snapshots of a website directly. Just use your favorite search engine and you will fine a few. If this is for a commercial project, I might make something for you.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: RevBrowser - snapshots: not good.
Hi Mark,
I use snapshots a lot. For my uses it works very well if I stick to PNG, which is my favorite format anyway because of transparency.
In my experience snapshots are fast enough if you dont want to repeatedly take snapshots from the whole desktop.
But then you have more experience with snapshots since you did the snapper application, an application that lets one do screen recording.
For all my needs and for probably most uses snapshots are reliably working and well worth doing from within Livecode.
There might be cases where other methods are more appropriate, but still.
Kind regards
Bernd
I use snapshots a lot. For my uses it works very well if I stick to PNG, which is my favorite format anyway because of transparency.
In my experience snapshots are fast enough if you dont want to repeatedly take snapshots from the whole desktop.
But then you have more experience with snapshots since you did the snapper application, an application that lets one do screen recording.
For all my needs and for probably most uses snapshots are reliably working and well worth doing from within Livecode.
There might be cases where other methods are more appropriate, but still.
Kind regards
Bernd
Re: RevBrowser - snapshots: not good.
Hi Bernd,
Snapper isn't the only project for which I use snapshots. In fact, I have multiple projects that I never started because of aformentioned problems.
One more thing to add: on Windows, snapshots interfere with the Windows user interface, causing weird effects, such as flashing or disappearing menus, if Revolution takes snapshots in the background while one is working with a different programme.
Best,
Mark
Snapper isn't the only project for which I use snapshots. In fact, I have multiple projects that I never started because of aformentioned problems.
One more thing to add: on Windows, snapshots interfere with the Windows user interface, causing weird effects, such as flashing or disappearing menus, if Revolution takes snapshots in the background while one is working with a different programme.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: RevBrowser - snapshots: not good.
Hello,
Thanks to everyone who responded to my thread - all very useful stuff.
@shaosean and @bn I will work with your suggestions/stacks today and see what happens. Thank you for your contribution.
@Mark - The suggestion of using a command line tool is a good one. I would like to work with a solution using the revBrowser if it's possible, noting the bug issues in this thread. But I will keep you in mind for assistance if I get really stuck - Yes it is for a commercial project, but in terms of budget I'm only a single person developer.
I agree with Klaus that sample stacks should work! Common sense really. As I'm also researching other development environments I may well have concluded that LiveCode does not deliver for pro work. Ok, I've used Rev before so I know what it can do with a little effort.
I must say that my motivation to work with LiveCode is that it "maps" to the way I think more than most other languages/methodologies. The only other thing that does the same thing is Forth - a wonderful language designed by Chuck Moore. I used it to programme micro-controllers in the late 80s to develop underwater marine instruments.
Right, better get to work on some of these tips - Thanks again.
Kind Regards, David
Thanks to everyone who responded to my thread - all very useful stuff.
@shaosean and @bn I will work with your suggestions/stacks today and see what happens. Thank you for your contribution.
@Mark - The suggestion of using a command line tool is a good one. I would like to work with a solution using the revBrowser if it's possible, noting the bug issues in this thread. But I will keep you in mind for assistance if I get really stuck - Yes it is for a commercial project, but in terms of budget I'm only a single person developer.
I agree with Klaus that sample stacks should work! Common sense really. As I'm also researching other development environments I may well have concluded that LiveCode does not deliver for pro work. Ok, I've used Rev before so I know what it can do with a little effort.
I must say that my motivation to work with LiveCode is that it "maps" to the way I think more than most other languages/methodologies. The only other thing that does the same thing is Forth - a wonderful language designed by Chuck Moore. I used it to programme micro-controllers in the late 80s to develop underwater marine instruments.
Right, better get to work on some of these tips - Thanks again.

Kind Regards, David
Re: RevBrowser - snapshots: not good.
Hi,
Just put the kettle on for a cuppa after a couple of hours of Livecode hacking.
Ok, I could not get the "set the text of image..." code to work at all. Nothing to report as to why at present. No image appeared at all in the target image.
Bernd - your stack works fab business! The only downside to the export snapshot method is that any floating window in front of the browser area gets captured as well. But it maybe a workable solution until the revBrowser snapshot bug is sorted. It is going to get sorted - yes? Perhaps I should add a comment to bug #4967.
Well I have learnt a lot more about Livecode today - didn't know of the export (snapshot) keywords - so a good morning all round.
Thank you folks!
Will continue to explore solutions to this issue especially as I'm on a learning curve, but I am a bit unnerved about using revBrowser in my planned project at present due to the snapshot bug.
Kind Regards, David.
Just put the kettle on for a cuppa after a couple of hours of Livecode hacking.

Ok, I could not get the "set the text of image..." code to work at all. Nothing to report as to why at present. No image appeared at all in the target image.
Bernd - your stack works fab business! The only downside to the export snapshot method is that any floating window in front of the browser area gets captured as well. But it maybe a workable solution until the revBrowser snapshot bug is sorted. It is going to get sorted - yes? Perhaps I should add a comment to bug #4967.
Well I have learnt a lot more about Livecode today - didn't know of the export (snapshot) keywords - so a good morning all round.

Will continue to explore solutions to this issue especially as I'm on a learning curve, but I am a bit unnerved about using revBrowser in my planned project at present due to the snapshot bug.
Kind Regards, David.
-
- Posts: 1
- Joined: Thu Nov 04, 2010 3:34 pm
Re: RevBrowser - snapshots: not good.
Any other thoughts on this?
I am creating a shopping app that makes extensive use of snapshots. For example, snapshots of amazon, google, etc based on a search term. The user could then select the snapshot of the site they wished to use.
The reason I would like to use revBrowserSnapshot is that it was that I believed that the revBrowser(s) could be off screen so that I could hide the multiple browsers I would need to use as the source of the snapshots. For that reason the suggestions of taking a snapshot of global coordinates will not work.
I have tried setting the text and image data of the destination image and I still get garbage.
Following the docs and the suggestions, here is the current state of my code:
The images snap 1 and image 1 are the same size and both have borders turned off.
I would like to see the details of bug 4967 to see if there is any additional information, but it seems that I can not create an account to log in with.
Again, any thoughts or suggestions on this would be appreciated.
Regards,
Robert
I am creating a shopping app that makes extensive use of snapshots. For example, snapshots of amazon, google, etc based on a search term. The user could then select the snapshot of the site they wished to use.
The reason I would like to use revBrowserSnapshot is that it was that I believed that the revBrowser(s) could be off screen so that I could hide the multiple browsers I would need to use as the source of the snapshots. For that reason the suggestions of taking a snapshot of global coordinates will not work.
I have tried setting the text and image data of the destination image and I still get garbage.
Following the docs and the suggestions, here is the current state of my code:
Code: Select all
put the windowid of this stack into tWinID
put revBrowserOpen(tWinID,"http://www.google.com") into sBrowserId
revBrowserSet sBrowserId, "scrollbars", false
revBrowserSet sBrowserId, "showborder", false
revBrowserSet sBrowserId, "rect", rect of img "image 1"
wait for 2 seconds
revBrowserSnapshot sBrowserId, "tSnapshot"
set the imageData of image "snap 1" to tSnapshot
I would like to see the details of bug 4967 to see if there is any additional information, but it seems that I can not create an account to log in with.
Again, any thoughts or suggestions on this would be appreciated.
Regards,
Robert
Re: RevBrowser - snapshots: not good.
Hi Robert,dirkgently wrote:
I would like to see the details of bug 4967 to see if there is any additional information, but it seems that I can not create an account to log in with.
Again, any thoughts or suggestions on this would be appreciated.
I think the quality control site is only visible to developers who have purchased a support plan - not 100% sure about this, so don't quote me.

I did email Rev support about bug #4967 to cast my "vote" and they replied that my comments were noted. I'm not really in a position to do more that that at the moment as I'm using a trial version of LiveCode. However, I am hoping to place an order for the pro version once my Mac arrives this week which may give me more rights to vote for bug fixes.
What I would suggest is that you contact RunRev to express your interest in getting this bug fixed. Like you, it's vital to me that this bug is fixed, so I would like to see progress too.
Kind Regards, David.
Re: RevBrowser - snapshots: not good.
Robert,
I thought maybe one could move the browser with the browser rect off screen and take a snapshot from the global location, unfortunately this seems not to work.
I looked again at the imagedata returned by the revbrowsersnapshot. It is distorted. I added a comment to bug #4967
Well, I am afraid that it will take a while for the revbrowserSnapshot be be fixed.
Unless of course a lot of people write to support and ask for a working revbrowsersnapshot as David and you apparently did.
With the advent of Livecode mobile a lot of resources go into bringing this to a releasable version. This understandably takes precedence in my view. A lot of people want to use the mobile platform.
Well, sorry, a lot of things in Livecode can be worked around by tackling it from a different angle, I did not find a way this time except for the global coordinates.
regards
Bernd
I thought maybe one could move the browser with the browser rect off screen and take a snapshot from the global location, unfortunately this seems not to work.
I looked again at the imagedata returned by the revbrowsersnapshot. It is distorted. I added a comment to bug #4967
Well, I am afraid that it will take a while for the revbrowserSnapshot be be fixed.
Unless of course a lot of people write to support and ask for a working revbrowsersnapshot as David and you apparently did.
With the advent of Livecode mobile a lot of resources go into bringing this to a releasable version. This understandably takes precedence in my view. A lot of people want to use the mobile platform.
Well, sorry, a lot of things in Livecode can be worked around by tackling it from a different angle, I did not find a way this time except for the global coordinates.
regards
Bernd