On_Rev: include graphics in html documents?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
On_Rev: include graphics in html documents?
Has anyone tried to create a html page using .irev code that returned a graphics to the user?
I do not yet have an On-Rev account but would like to know if you can include graphics into a html file created server-side by .irev code just as you would create text contents.
Thank you.
I do not yet have an On-Rev account but would like to know if you can include graphics into a html file created server-side by .irev code just as you would create text contents.
Thank you.
Re: On_Rev: include graphics in html documents?
ukimiku,
have a look at Sarah Reichelt's site
http://www.troz.net/onrev/
she shows nice examples what she does with on-rev server side scripting and has the source code also.
You can easily see how she did it.
I don't know what exactly you mean by graphic: you certainly can include images, but graphics I don't know.
regards
Bernd
have a look at Sarah Reichelt's site
http://www.troz.net/onrev/
she shows nice examples what she does with on-rev server side scripting and has the source code also.
You can easily see how she did it.
I don't know what exactly you mean by graphic: you certainly can include images, but graphics I don't know.
regards
Bernd
Re: On_Rev: include graphics in html documents?
Bernd,
this is a very nice link to a beautiful example of irev scripting from which I am going to learn a lot, I am sure. The more examples like these I see, the more attractive On-Rev becomes. Since Sara - somehow - manages not only to download images to the browser but also to upload them, the capabilities of irev scripting seem to suffice for my purposes.
I get the impression, though, that graphics as such cannot currently be sent to the browser. I suppose that first they have to be rendered as a bitmap picture; a snapshot should do. Otherwise, I imagine, one would have to resort to reformatting the graphics in terms of canvas commands - which in turn would bring up severe compatibility issues with the Internet Explorer and its proprietary vector format, and would complicate program logic a lot, urging to include Javascript for client-side scripting, browser switches, and whatever...
Thanks for pointing me there!
this is a very nice link to a beautiful example of irev scripting from which I am going to learn a lot, I am sure. The more examples like these I see, the more attractive On-Rev becomes. Since Sara - somehow - manages not only to download images to the browser but also to upload them, the capabilities of irev scripting seem to suffice for my purposes.
I get the impression, though, that graphics as such cannot currently be sent to the browser. I suppose that first they have to be rendered as a bitmap picture; a snapshot should do. Otherwise, I imagine, one would have to resort to reformatting the graphics in terms of canvas commands - which in turn would bring up severe compatibility issues with the Internet Explorer and its proprietary vector format, and would complicate program logic a lot, urging to include Javascript for client-side scripting, browser switches, and whatever...
Thanks for pointing me there!
Re: On_Rev: include graphics in html documents?
ukimiku,
this looks very promising for On-Rev:
http://n4.nabble.com/revlet-test-html-t ... ml#a930584
this is from a discussion on the list.
Ralf Bitter released an alpha version of a Web Application Development Framework for use with sever side scripting version of RunRev.
You find it here:
http://revigniter.rabit.on-rev.com/
You might also want to have a look at
http://forums.on-rev.com
a forum for on-rev. I think you have to register to view it.
regards
Bernd
this looks very promising for On-Rev:
http://n4.nabble.com/revlet-test-html-t ... ml#a930584
this is from a discussion on the list.
Ralf Bitter released an alpha version of a Web Application Development Framework for use with sever side scripting version of RunRev.
You find it here:
http://revigniter.rabit.on-rev.com/
You might also want to have a look at
http://forums.on-rev.com
a forum for on-rev. I think you have to register to view it.
regards
Bernd
Re: On_Rev: include graphics in html documents?
Bernd,
thanks for the links.
In an e-mail, Sarah Reichelt told me that iRev scripts cannot access stack files, and she does not see any way to create a graphics server-side only using iRev scripts. My first thought was "Oh well, then I just go about it by creating a bitmap image, storing that temporarily on the server and embed an html link to that bitmap." I am not sure yet whether iRev scripting supports creating dynamic bitmap images. (Frankly, I was under the impression that iRev would bring the power of RevTalk to server-side scripting. This, apparently, is not the case, which is why, at the moment, I am somewhat disappointed). Sarah recommended calling ImageMagick (via the issueing of a shell command, I suppose, as her examples for image resizing demonstrate), which I don't know the least of as of yet, but well, what is a brain for...
The revIgniter looks promising, but everything to do with image manipulation will yet have to come.
I have registered with forums.on-rev.com, but my account activation is still pending (has to be done manually by some admin, it seems). Thanks for the link.
Now, basically, I am back again almost where I started: how to include an image/picture with an html document created by an iRev script. I will post this to the specialized lists as soon as I am admitted, but maybe I have to consider more options like creating the whole thing in PHP. Which would be a pity, of course, since coding in RevTalk is MUCH more fun.
Again, thanks!
Regards
thanks for the links.
In an e-mail, Sarah Reichelt told me that iRev scripts cannot access stack files, and she does not see any way to create a graphics server-side only using iRev scripts. My first thought was "Oh well, then I just go about it by creating a bitmap image, storing that temporarily on the server and embed an html link to that bitmap." I am not sure yet whether iRev scripting supports creating dynamic bitmap images. (Frankly, I was under the impression that iRev would bring the power of RevTalk to server-side scripting. This, apparently, is not the case, which is why, at the moment, I am somewhat disappointed). Sarah recommended calling ImageMagick (via the issueing of a shell command, I suppose, as her examples for image resizing demonstrate), which I don't know the least of as of yet, but well, what is a brain for...

The revIgniter looks promising, but everything to do with image manipulation will yet have to come.
I have registered with forums.on-rev.com, but my account activation is still pending (has to be done manually by some admin, it seems). Thanks for the link.
Now, basically, I am back again almost where I started: how to include an image/picture with an html document created by an iRev script. I will post this to the specialized lists as soon as I am admitted, but maybe I have to consider more options like creating the whole thing in PHP. Which would be a pity, of course, since coding in RevTalk is MUCH more fun.
Again, thanks!
Regards
Re: On_Rev: include graphics in html documents?
If you want to create images on the fly while still using rev for the rest of the page you can use php and DG to do so. Or imageMagick also i'm sure.
With DG I put this into a php file.
Then in my irev file I put this.
It would be easy to modify it to accept GET strings as part of the url so the text itself could be whatever you wished.
Kinda wish rev would build dg and imagemagic support into the on-rev engine, would be very cool to be able to create images on the fly that way without resorting to going external.
Or am I mistaken and it IS possible?
With DG I put this into a php file.
Code: Select all
<?php
header("Content-type: image/png");
$t = "This is text";
$im = @imagecreate(128, 16) or die("Cannot Initialize new GD image stream");
$bc = imagecolorallocate($im, 0, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 1, 4, 4, $t, $tc);
imagepng($im);
imagedestroy($im);
?>
Code: Select all
<?rev
put "<img src=" & quote & "http://terminal.on-rev.com/test.php" & quote & ">"
?>
Kinda wish rev would build dg and imagemagic support into the on-rev engine, would be very cool to be able to create images on the fly that way without resorting to going external.
Or am I mistaken and it IS possible?
Re: On_Rev: include graphics in html documents?
@sturgis:
thanks. With "DG" you mean "GD", or am I mistaken? I can only find references to php and graphics libaries with "GD".
Your code looks interesting, and I understand the logic. Maybe I will go for this for the final version of my program. For now, as to creating the image, I have decided to settle for a pure client-side Javascript option, and I actually managed to find a free Javascript image creation library that actually runs on *all* browsers, including IE 8, with backward compatibility even as far back as Netscape 4. Which is not necessary, but reassuing, since the code seems to be really robust. I have managed so far to create a basic radar plot skeletton using this technique, and am content, at least for the moment, that is. I have to deliver a first working prototype on Friday, so I considered that setting up the On-Rev account, getting to know iRev, GD,.. would take some time which I, for now, would rather invest into coding.
Anyhow, I will save your helpful post and get back to it somewhat later, as soon as I have worked out the workings of the combination of On-Rev, iRev, PHP, and GD. Hey, what a learning curve!
P.S. I really don't get why iRev does not simply mirrow RevTalk with the single one exception of stack UI-related issues. Pictures,... are only constructs in memory, and it should be able to code iRev scripts just the way one codes RevTalk. Then "put image i", and the scripting engine takes care of the rest. It's not as advertised (you speak English, so you can code iRev scripts, it's far more complicated then RevTalk.) Not really a revolution.
Regards,
thanks. With "DG" you mean "GD", or am I mistaken? I can only find references to php and graphics libaries with "GD".
Your code looks interesting, and I understand the logic. Maybe I will go for this for the final version of my program. For now, as to creating the image, I have decided to settle for a pure client-side Javascript option, and I actually managed to find a free Javascript image creation library that actually runs on *all* browsers, including IE 8, with backward compatibility even as far back as Netscape 4. Which is not necessary, but reassuing, since the code seems to be really robust. I have managed so far to create a basic radar plot skeletton using this technique, and am content, at least for the moment, that is. I have to deliver a first working prototype on Friday, so I considered that setting up the On-Rev account, getting to know iRev, GD,.. would take some time which I, for now, would rather invest into coding.
Anyhow, I will save your helpful post and get back to it somewhat later, as soon as I have worked out the workings of the combination of On-Rev, iRev, PHP, and GD. Hey, what a learning curve!
P.S. I really don't get why iRev does not simply mirrow RevTalk with the single one exception of stack UI-related issues. Pictures,... are only constructs in memory, and it should be able to code iRev scripts just the way one codes RevTalk. Then "put image i", and the scripting engine takes care of the rest. It's not as advertised (you speak English, so you can code iRev scripts, it's far more complicated then RevTalk.) Not really a revolution.
Regards,
Re: On_Rev: include graphics in html documents?
Yeah GD. Dyslexic moment!
Re: On_Rev: include graphics in html documents?
.... thanks for this - explains why the expected commands below would NOT work!
NOR the following - which of course otherwise works quite well within a stack, and is what I'd personally really like to be able to achieve with on-rev!
(and yes - I realise I do not 'need' the html < p > tags)
Code: Select all
<p><?rev
put "<img src=" & " & "http://www.site.com/images/example.jpg" & " & "/ >"
?></p>
Code: Select all
<p><?rev
create image "example"
set the loc of image "example" to 300,400
set the filename of image "example" to "http://www.site.com/images/example.jpg"
?></p>
[url=http://www.fourhares.com]fourhares.com[/url]