hi,
How can we ask the user to enter the image file in perlmagick?
like in perl,
we can ask...
print "please enter the input file ";
Is there a option like this in perlmagick to take the input from the user in reading it??
Also please tell me the command for resizing an image.
I'm writing like this:
$image->Resize(geometry => '$a x $y');
where $a and $y are defined earlier in the code.
but this is nt working
giving filename in PERLMAGICK
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: giving filename in PERLMAGICK
Asking the user about something is done in the perl part, not the imagemagick part. It has nothing to do with IM.
That resize method should also work just fine.
However be warned that the perl (or other) API's may not follow the Comannd Line API, in attempting to preserve an images aspect ratio. Basically test and make sure it does what you expect first.
That resize method should also work just fine.
However be warned that the perl (or other) API's may not follow the Comannd Line API, in attempting to preserve an images aspect ratio. Basically test and make sure it does what you expect first.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: giving filename in PERLMAGICK
Thank you.
The resize part is working fine....can you please tell me the syntax to ask user the input in perlmagick?
The resize part is working fine....can you please tell me the syntax to ask user the input in perlmagick?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: giving filename in PERLMAGICK
Reading input is reading a line either from normal STDIN.
or if you are security concious (passwords), or are using STDIN for a file, then open "/dev/tty" and read a line from it.
As I said the ImageMagick module is not needed for input in perl.
or if you are security concious (passwords), or are using STDIN for a file, then open "/dev/tty" and read a line from it.
Code: Select all
#/usr/bin/perl
#
#
print "Type something: ";
my $input = <STDIN>;
print "the user typed: $input\n";
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/