onrev, imageMagick and accessing images in a user-defined directory

Nicolas Cueto niconiko at gmail.com
Mon Feb 14 23:44:53 EST 2011


Maybe I should've marked this off-topic...


My goal is an irev script ("<?rev ... ?>") that, thru shell commands,
uses ImageMagick to work with images, with everything happening/stored
in my onrev account.


My first step was to study Sarah Reichelt's "Numeric display" irev
script (thank you, Sarah!). Happily, I could get the following irev
code to work:

----------------------------------------
<?rev
put "http://myURL.com/imageDirectory/myImage.jpg" into pPicPath
put "identify " & pPicPath into tCmd
put shell(tCmd) into tSize
put word 3 of tSize into tSize
replace "x" with comma in tSize
put tSize
?>
------------------------------------------

The thing is, though, my images are actually in a user-defined
directory. So, I modified the above to:

--------------------------------------------
<?rev
put "http://userID:userPassword@myURL.com/imageDirectory/myImage.jpg
...
?>
--------------------------------------------

Of course, this didn't work.


So, my next step was to ask at the ImageMagick forum. This is the reply I got:

"The ability for convert to download a web image is purely a
convenience function. Internally it calls wget (command delegate) to
do the task.

If you need something more complex then you are better of DIY the wget
command your self.
You can avoid saving an intermediate download image by 'pipeing' from
wget into convert."


Kind of understand this reply. But am hoping someone here familiar
with onrev and maybe even ImageMagick can guide me about how to do
what this writer is suggesting.

In the meantime, I set off on a journey of discovery to figure out on
my own how to do this. Please someone call me back to port with a
treasure map!!

Cheers.

--
Nicolas Cueto




More information about the use-livecode mailing list