How to pass variables to ImageMagick using a [shell] context?
numero = 41[text]height=100[/text][text]width=100[/text][text]sourcefile=logo.jpg[/text][text]resultfile=result.jpg[/text]Then you would a use a [shell] script like this (in your SandBoxes scripts) to resize the image.
[shell]path-to-ImageMagick/convert -size [width]x[height] [sourcefile] -resize [width]x[height] +profile "*" [resultfile][/shell]Simply set the variable on the page above the [shell], and when you construct the script you want to run within [shell], just drop the [variable] in.
[text]height=100[/text]
[text]width=100[/text]
[text]sourcefile=logo.jpg[/text]
[text]resultfile=result.jpg[/text]
[shell]
path-to-ImageMagick/convert -size [width]x[height] [sourcefile] -resize [width]x[height] +profile "*" [resultfile]
[/shell]
DOWNLOAD WEBDNA NOW!
WebDNA applications...
Tips and TricksA list of user-submitted tips ...
F.A.QA compilation of some user's questions...
WebDNA ModulesA list of the currently available modules...
Technical Change HistoryThis Technical Change History provides a reverse chronological list of WebDNA changes...
WebDNA reference...
Reuse the same code over and over again on your site with the [include] context...
Spaghetti codeHow to get rid of very long search strings...
How to keep the text variable after a function has finishedBy default...
ImageMagickUse ImageMagick to manipulate images when you upload them...
Using a simple Array of Variables with [interpret]The [interpret] context is very powerful command in the hands of a skilled WebDNA programmer...
Annoying character on writefileHow do I get rid of or convert the line feed character during a writefile?...