This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Webmaster forum > July 2005 > ImageMagick?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Gandalf Parker 2005-07-07, 7:40 pm |
| Does anyone have any CGI interface stuff to ImageMagick commands?
Ive started playing with this and it seems as though it offers about 800%
the amount of capability that anyone seems to have made any use of. Or at
least, that they have posted on the net (yes I think I have any links for
it that Google has).
Gandalf Parker
--
Yes my brain works hard.
And I would be rich if my fingers werent so damn lazy
| |
| Todd H. 2005-07-07, 7:40 pm |
| Gandalf Parker <gandalf@most.of.my.favorite.sites> writes:
> Does anyone have any CGI interface stuff to ImageMagick commands?
> Ive started playing with this and it seems as though it offers about 800%
> the amount of capability that anyone seems to have made any use of. Or at
> least, that they have posted on the net (yes I think I have any links for
> it that Google has).
I have a cpanel account that seems to have an image management panel
that is likely just a front end to the convert binary....
--
Todd H.
http://www.toddh.net/
| |
| Todd H. 2005-07-07, 11:44 pm |
| Gandalf Parker <gandalf@most.of.my.favorite.sites> writes:
> Gandalf Parker <gandalf@most.of.my.favorite.sites> wrote in
> news:Xns968C5AC1BA35gandalfparker@208.201.224.154:
>
>
> OK so far the answer seems to be "no".
Or the question not terribly well asked.
Give a specific example of the sort of thing you are looking to do
with it.
Best Regards,
--
Todd H.
http://www.toddh.net/
| |
| mbstevens 2005-07-08, 8:34 am |
| Gandalf Parker wrote:
> Gandalf Parker <gandalf@most.of.my.favorite.sites> wrote in
> news:Xns968C5AC1BA35gandalfparker@208.201.224.154:
>
>
>
>
> OK so far the answer seems to be "no".
>
> Thats too bad. Well I guess I can probably muddle thru the html and cgi
> part, and ask harder questions in the graphics forums. Sure looks like a
> fun toy.
> ..........
> Yes there is a module to interface to about 20 different programming
> languages. But it still doesnt look like anyone did anything with it.
I use it with PERL on my own computer to preprocess image files for
webpages.
You might try searching around in here:
http://cgi.resourceindex.com/Programs_and_Scripts/Perl/
>Besides, Id rather just have a CGI that made use of ImageMagick rather
>than
>a "get this language, get this library, get this module, then this will
>work" finished product. But if anyone has done one Im willing to look
>at it.
Since you're posting agent is Xnews, I assume you're
on GNU/Linux. Image Magick is probably already on your
computer. It can be scripted with the bash shell quite
easily. Try googling for a "bash Image Magick script" or
the like. But that doesn't get you to CGI.
Over dialup, Image::Magick PERL module might take 30 minutes over dialup
from CPAN.
http://search.cpan.org/~jcristy/Per...-6.20/Magick.pm
You won't need to download PERL on a Linux machine. It is already
there. At the top of your PERL program, after installing the
Image::Magick module, just put:
use Image::Magick;
use use CGI qw/:standard/;
The CGI module will already be installed.
Image::Magick comes with its own documentation.
So does CGI. And, image magick will likely be
on your machine already. If you do a search for
Image::Magick at CPAN there are several pages of
related modules.
For complete scripts that use Image::Magick, you
are going to have to do the download anyway.
--
mbstevens
http://www.mbstevens.com/
| |
| Robert Broughton 2005-07-08, 7:48 pm |
| John Bokma wrote:
>
> I am 100% sure that several people have used the ImageMagick library
> with perl:
You can add me to the list. I found the ImageMagick library very easy to
work with.
--
Bob Broughton
http://broughton.ca/
Vancouver, BC, Canada
"Not all carcinogens are known to cause cancer in humans."
- Todd Benson, mailto:tbenson37@cox.net , Oct. 24, 2004
| |
| Gandalf Parker 2005-07-08, 7:48 pm |
| comphelp@toddh.net (Todd H.) wrote in news:84zmsykwk2.fsf@ripco.com:
> Gandalf Parker <gandalf@most.of.my.favorite.sites> writes:
>
>
> Or the question not terribly well asked.
Well I tried to forestall the usual google responses. Im barely above an
average user on many things but I consider myself a fairly expert
googler. :) Most of the google links on ImageMagick tend to be
instructions how to install it, or links to the ImageMagick
documentation. Or they are information on how to use IM with Perl, or
Javascript, or C++, or PHP. There are only 2 sites Ive found with real
info on USING ImageMagick and none which seem to use simple HTTP for
interfacing.
I was hoping that someone here had actually done some CGI->ImageMagick
stuff
> Give a specific example of the sort of thing you are looking to do
> with it.
Well it would most likely be for my linux server. And I wanted to find
something that was baseline simple so I could expand on it. Now it looks
like I might end up looking for pieces and work from there.
IM has commands which can create some majorly kewl backgrounds. Plasmas,
swirls, blurs, speckles, all kinds of stuff. It also has some slick
commands for creating graphics of a text phrase. Im suspecting that sites
such as this one...
http://linuxenvy.com/bprentice/Banners/Banners.html
call ImageMagick with the form results in order to create their effects.
So the pieces that I might be interested in now would be for selecting
colors, for selecting fonts, for inputting a simple line of text, then
calling a program to create the image (probably go with PNG even though
it will make anything) then display the result.
At this point I guess Im looking for html examples of the selection
process. Im probably going to write my own CGIs in basic or shell since
all I need is simple text processing and a random.
Gandalf Parker
--
I knew DOS before you thought it was spelled DoS
I knew Unix before you thought it was spelled Linux
and I knew Internet before you thought it was spelled WWW
| |
|
|
| John Bokma 2005-07-08, 7:48 pm |
| Gandalf Parker <gandalf@most.of.my.favorite.sites> wrote:
> I was hoping that someone here had actually done some CGI->ImageMagick
> stuff
CGI is a gateway interface. It's just a set of rules how a webserver can
talk with a program, and the program can talk back.
Since most stand alone programs can't interpret the webserver lingo, nor
talk back in the right lingo, you need a kind of glue.
Perl is glue.
So if you want to write a CGI solution using ImageMagick, you have to
use glue like Perl
> IM has commands which can create some majorly kewl backgrounds.
> Plasmas, swirls, blurs, speckles, all kinds of stuff.
But it probably doesn't know how to send back the correct header. You
might even use a shell script, e.g.
#!/path/to/shell
echo "Content-type: image/jpeg"
echo
imagemagick call which outputs the picture
(Note there might be errors in the above, haven't been shell scripting
for ages).
> It also has some
> slick commands for creating graphics of a text phrase. Im suspecting
> that sites such as this one...
> http://linuxenvy.com/bprentice/Banners/Banners.html
> call ImageMagick with the form results in order to create their
> effects.
Hence, you need to obtain the form results, massage it in something IM
can use, and send the resulting image back. I am sure IM can't do that
alone, so you need help: Perl, shell script, C, PHP, etc.
> So the pieces that I might be interested in now would be for selecting
> colors, for selecting fonts, for inputting a simple line of text,
Form
> then
> calling a program to create the image (probably go with PNG even
> though it will make anything)
You missed a step: you need to extract the form input from the data the
webserver makes available using CGI (if you use Perl, use the CGI
module, don't make a bad wheel).
> then display the result.
Again, you have to do some extra work, you have to send the right
headers before the image.
> At this point I guess Im looking for html examples of the selection
> process. Im probably going to write my own CGIs in basic or shell
> since all I need is simple text processing and a random.
You need a CGI library. If that's available for BASIC, use BASIC. Shell
can be used for simple output, but for handling forms you must have a
very firm understanding of how CGI works.
I would say, learn Perl, reading a form parameter (e.g. message) is
just:
#!/usr/bin/perl -T
use strict;
use warnings;
use CGI::Carp 'fatalsToBrowser';
use CGI;
my $cgi = new CGI;
my $message = $cgi->param( 'message' );
defined $message or die "parameter 'message' undefined";
# ...
print $cgi->header( 'text/plain' );
print "Your message is: $message\n";
You *should* check $message further (for example length). Also note that
the die reports an error. $message is undefined if either the script was
called without using the form, or if you made an error in your form. I
recommend *not* fixing this (for example by supplying a default message)
since both fall outside normal usage.
Now try to do something simple as the above using BASIC or shell...
--
John PERL SEO tools: http://johnbokma.com/perl/
Experienced (web) developer: http://castleamber.com/
Get a SEO report of your site for just 100 USD:
http://johnbokma.com/websitedesign/seo-expert-help.html
| |
| William Tasso 2005-07-08, 7:48 pm |
| Writing in news:alt.www.webmaster
From the safety of the Castle Amber - software development cafeteria
John Bokma <john@castleamber.com> said:
> ...
> Xnews does have a confusing name ...
how so? seems the name has all the necessary attributes for a modrern
world news interface ... well it contains 'news' and the rather groovy 'X'
prefix. What could be more simple? :)
--
William Tasso
** Business as usual
| |
| mbstevens 2005-07-08, 7:48 pm |
| John Bokma wrote:
> mbstevens <NOXwebmasterx@xmbstevensx.com> wrote:
>
>
>
>
> Xnews does have a confusing name, but it's really a Windows program
> (written in Delphi IIRC).
>
Damn -- thought GNU had all that X stuff patented! ;)
| |
| Gandalf Parker 2005-07-08, 7:48 pm |
| Message-ID: <Xns968D7FFB228B5gandalfparker@208.201.224.154>
User-Agent: Xnews/5.04.25
Lines: 32
Date: Fri, 08 Jul 2005 19:34:56 GMT
NNTP-Posting-Host: 63.199.8.154
X-Complaints-To: abuse@sonic.net
X-Trace: typhoon.sonic.net 1120851296 63.199.8.154 (Fri, 08 Jul 2005 12:34:56 PDT)
NNTP-Posting-Date: Fri, 08 Jul 2005 12:34:56 PDT
Xref: number1.nntp.dca.giganews.com alt.www.webmaster:430863
mbstevens <NOXwebmasterx@xmbstevensx.com> wrote in news:KEzze.575$dU3.233
@newsread2.news.pas.earthlink.net:
> John Bokma wrote:
> Damn -- thought GNU had all that X stuff patented! ;)
Heehee. Ive gotten jumpy at anything starting with an X also. I like to
use my linux server as just a server with no GUIs. And my WinXP is for
desktop stuff and GUI stuff.
XNews is a great news program that I NEVER recommend to users. :)
It does a sweet job of handling news servers for those who have access to
multiple news services. I can group different newsgroups and have it go
to different servers to get them. Very handy for admin types.
Unfortunately users tend to screw it up. They create multiple folders to
organize their binarys from their games newsgroups from their news
newsgroups, but they leave them all going to the same server. They get
the dreaded "too many connections" error which leads them to believe that
their ISP is being cheap on the service allowing too few people in at a
time without realizing that they themselves are trying to get in as 10
users every time they connect.
Gandalf Parker
| |
| mbstevens 2005-07-08, 11:30 pm |
| John Bokma wrote:
> CGI is not simple, hence most sane programmers use a library :-). I have
> seen so many flawed hand written CGI implementations to state the above
> :-)
It is easy to write a basic CGI handler -- just takes a few lines.
Unfortunately, such a handles are virtually guaranteed to have security
holes.
High level modules like CGI.pm are the only way to go, unless you plan
to devote large chunks of your future life to honing your handler.
CGI.pm also has transparent ways to maintain state. This is another
place a basic handler fails.
| |
| Gandalf Parker 2005-07-08, 11:31 pm |
| John Bokma <john@castleamber.com> wrote in
news:Xns968DAA6357000castleamber@130.133.1.4:
> Gandalf Parker <gandalf@most.of.my.favorite.sites> wrote:
>
> Yes, you have to have a programming language to do CGI :-) CGI alone
> is nothing, it's just a set of rules.
I know what CGI is. I was around for its birth.
>
> They can implement the CG interface as long as they can handle
> processing stdin, writing to stdout, and reading environment
> variables.
CGI is strictly a gateway. Something as simple as this works..
#!/bin/sh
/bin/touch
echo
Ive used things like that before to create saftey backdoors on systems.
Well I suppose in the above example you could count the shell as your
"glue" but the only thing you get from it is a blank screen.
[color=darkred]
> but as soon as you want to do something with the QUERY_STRING, or
> handle a POSTed form you need to write a lot of code to do the
> decoding, etc. You will make many errors that others have made before
> you, hence I recommend using a library, for example in combination
> with Perl.
Ahh now we are getting somewhere, use of words like "recommend" is good.
> Trust me, you don't want to parse form results in a shell script.
Because it would a rough road already trodden by others? Thanks.
>
> Pointers have already been given. Moreover, check the site:
>
> http://www.imagemagick.org/script/perl-magick.php
>
> A word of warning: the PERL examples are horribly written, don't use
> them to learn Perl.
You sent me to the home site of ImageMagick and then say the examples are
horrible? Yes Ive seen those. Im fairly sure Ive seen anything that can
be googled.
>
> Yes, if cgi = CGI module of Perl.
WHAT?
> CGI is not simple, hence most sane programmers use a library :-). I
> have seen so many flawed hand written CGI implementations to state the
> above
>:-)
Hosting a security group on my machine and many honeypots I can say the
same, thanks.
> Programming depends a lot on being smart. Reinventing the wheel is not
> being smart. Moreover, badly written CGI implementations can be quite
> insecure...
Well some people have to hack or we would never progress. But thanks for
providing warnings to the masses. Try not to pepper in absolutes which
make it sound like there are no choices.
>
> That are not CGI, that are programming languages. Most of those
> languages one can use to implement a program that can talk with a
> webserver. In the past one had to write a wrapper for Java btw.
Yes they are CGI (well maybe not the PHP but thats getting technical).
Ive been sysadmining since before there were any CGIs. I do know the
difference between them and other code on the machine :)
> ImageMagick has a website, and I was able to find examples with one
> Google search. Not that they are good examples (Perl),
Correct. So *sigh* you are saying that you have no examples to provide?
Thank you.
> CGI sounds simple, but the number of huge security issues, bugs,
> flaws, etc in uncountable badly written scripts prove the opposite.
Well its not something I was going to offer others. And security issues
are fun.
Gandalf Parker
--
www.alt-hacker.org
the home of the alt.hacker newsgroup
(only white-hats need apply)
| |
| William Tasso 2005-07-08, 11:31 pm |
| Writing in news:alt.www.webmaster
From the safety of the cafeteria
Gandalf Parker <gandalf@most.of.my.favorite.sites> said:
> ...
> security issues are fun.
I am reminded of the curse: "may you have an interesting life"
--
William Tasso
** Business as usual
| |
| Gandalf Parker 2005-07-09, 7:28 pm |
| "William Tasso" <SpamBlocked@tbdata.com> wrote in news:op.stmdczx5m9g4qz-
wnt@tbdata.com:
> Writing in news:alt.www.webmaster
> From the safety of the cafeteria
> Gandalf Parker <gandalf@most.of.my.favorite.sites> said:
>
>
> I am reminded of the curse: "may you have an interesting life"
Which the new version has become: "may you give up Mac and start using
Windows" :)
Gandalf Parker
| |
|
|
| Gandalf Parker 2005-07-24, 11:50 pm |
| Toby Inkster <usenet200507@tobyinkster.co.uk> wrote in
news:pan.2005.07.24.22.37.36.854855@tobyinkster.co.uk:
> Gandalf Parker wrote:
>
>
> Do you mean the *Perl* interface? AFAIK, ImageMagick has no built-in
> *CGI* interface.
ImageMagick commands are executable from the command line without a menu
interface, so they dont need a CGI interface. Any executable can be
directly CGI'd
> Take a look at...
> http://examples.tobyinkster.co.uk/chess/
> http://tobyinkster.co.uk/steg-encode
Those are cool. Not quite what I wanted but very neat projects.
I guess I will just get around to tinkering a form-to-executable that
passes the variables. It would have been nice if someone had a "select
colors" form and a "select font" (which searched out the fonts to offer
them).
Gandalf Parker
| |
|
|
| Charles Sweeney 2005-07-25, 7:37 am |
| Toby Inkster wrote
> http://examples.tobyinkster.co.uk/chess/
Good work.
I've played the game for a good number of years, a few of them
competitively. Never heard of the Forsyth notation, or seen it in any
of the books I have.
Looks like a good way to record a position, but most scoresheets have a
blank board on the back, which does the job.
Do you know anyone who uses it?
--
Charles Sweeney
http://CharlesSweeney.com
| |
| Charles Sweeney 2005-07-25, 11:50 pm |
| Toby Inkster wrote
> Charles Sweeney wrote:
>
>
> Not really, but it seemed a sensible way of linearising a chess board
so
> that it could be passed in a query string.
Indeed.
> A question of dynamically generating a chess board representation came
up
> on a newsgroup (alt.html?) a couple of years ago, and that script was
my
> contribution to the discussion.
And a good solution it is too!
--
Charles Sweeney
http://CharlesSweeney.com
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|