Ask a Question related to PERL Modules, Design and Development.
-
Infochannel #1
Errror in mod Image::magick or something else?
Hi,
I've bought a perl script a few days ago, which will not work at all.
The programmer can't or will not help me in solving the problem. Maybe
somebody here can help me a little, because I'm not experienced with
perl
the problem: The script should load an image (onto another image) which
is temporarily stored until payment is verified. The script starts as
follows:
###################################
#!/usr/bin/perl
use DBI;
use CGI qw/:standard *table start_ul/;
use Image::Magick;
use Image::Info qw(image_info dim);
use Digest::MD5 qw(md5_hex);
use LWP::UserAgent;
foreach(url_param()){param($_,url_param($_))}
require '/www/infochannel.org/thepixelwars.de/admin/payperpixel.conf';
$src = Image::Magick->new;
$back = Image::Magick->new || die "cant create object back";
$time=time();$jscript='';
if (defined param('newpicture') and param('newpicture') ne
''){$time=param('newpicture')}
if (defined param('picture') and param('picture') ne ''){
my $file=upload('picture');
chomp $file;
$newfile="$tmpdir$time";
open (TMP,">$newfile")||die "cant write to $newfile $!";
while (<$file>){print TMP $_}
close(TMP);
my $info = image_info($newfile);
if ($info->{file_media_type} !~ /image/){
$message.=br."Sorry your file does not appear to be an image
file so
could not be used.";
unlink($newfile);
}
else {
param('newpicture',"$time");
}
}
##################
On my server all required modules are installed and working with other
scripts. OS is gentoo linux.
calling the script gives the error message "Sorry your file does not
appear to be an image file so could not be used."
and an empty space instead of the TMP image is shown.
Please see: [url]http://www.thepixelwars.de/maze/index.html[/url]
I've seen, that nothing is stored in the tmpdir, so its normal that
image::info gives that error.
I really would appreciate your help in solving the problem. At the
moment I have no more ideas.
p.s. the CHMODS of the tempdir and the image were to store the nefile
in are set to 777.
thanks in advance
Heiner
Infochannel Guest
-
Image magick palette
I searched a few and seems that here is the right place. I use image magick on Linux and also in windows. My question is how do I do in order to... -
Image::Magick and padding of image
I need to pad an image with a white border to make it fit a certain size. So far I've found the Border() method to do the job, but not quite. As... -
Image Magick
Mike At Spy wrote: the easiest way to remove them is to use RPM, if that was what was used to install them rpm -e ImageMagick if there are no... -
Image::Magick and Tk::Photo
I am trying to read in a bunch of images and manipulate them using Image::Magick, then display them using Tk::Photo. I would like to do this... -
[PHP] Image Magick
Mike -- ...and then Mike At Spy said... % % Anyone here familiar with the installation of Image Magick and what filesit % installs on your... -
Gunnar Hjalmarsson #2
Re: Errror in mod Image::magick or something else?
Infochannel wrote:
Then ask to have your money back. ;-)> I've bought a perl script a few days ago, which will not work at all.
> The programmer can't or will not help me in solving the problem.
<snip>
<snip>> use Image::Info qw(image_info dim);
<snip>> my $info = image_info($newfile);
> if ($info->{file_media_type} !~ /image/){
> $message.=br."Sorry your file does not appear to be an image
> file so could not be used.";
> unlink($newfile);
> }
If the problem would lie in a CPAN module, and not in the script, it's> On my server all required modules are installed and working with other
> scripts. OS is gentoo linux.
>
> calling the script gives the error message "Sorry your file does not
> appear to be an image file so could not be used."
the Image::Info module that is used for that check, not Image::Magick.
Have you checked that the file type is supported by the version of
Image::Info you are using?
Why? What has that page to do with it?> Please see: [url]http://www.thepixelwars.de/maze/index.html[/url]
Faulty conclusion, since the failed check removes the file.> I've seen, that nothing is stored in the tmpdir, so its normal that
> image::info gives that error.
--
Gunnar Hjalmarsson
Email: [url]http://www.gunnar.cc/cgi-bin/contact.pl[/url]
Gunnar Hjalmarsson Guest
-
Infochannel #3
Re: Errror in mod Image::magick or something else?
Thank's,
I've solved the problem
relacing the Iine
print start_form(-id=>'myform').
by
print start_multipart_form(-id=>'myform')
btw: the script is called at the above URL by clicking the "buy blochs"
button.
thank's again
Heiner
Infochannel Guest
-
Gunnar Hjalmarsson #4
Re: Errror in mod Image::magick or something else?
Infochannel wrote:
Okay, that's a common (the most common?) mistake when writing file> Thank's,
>
> I've solved the problem
>
> relacing the Iine
>
> print start_form(-id=>'myform').
>
> by
>
> print start_multipart_form(-id=>'myform')
upload apps. I wrote the CPAN module CGI::UploadEasy (not _only_ for
that reason...), which triggers a fatal error if it's feeded an
application/x-www-form-urlencoded POST request.
--
Gunnar Hjalmarsson
Email: [url]http://www.gunnar.cc/cgi-bin/contact.pl[/url]
Gunnar Hjalmarsson Guest
-
Infochannel #5
Re: Errror in mod Image::magick or something else?
Thanks again,
I would like to check your module (whre can I get it?)
Heiner Neuling
Infochannel Guest
-
Gunnar Hjalmarsson #6
Re: Errror in mod Image::magick or something else?
Infochannel wrote:
At search.cpan.org, since it's a CPAN module. Direct link:> Gunnar Hjalmarsson wrote:>>> Infochannel wrote:>>>>> I've solved the problem
>>>
>>> relacing the Iine
>>>
>>> print start_form(-id=>'myform').
>>>
>>> by
>>>
>>> print start_multipart_form(-id=>'myform')
>> Okay, that's a common (the most common?) mistake when writing file
>> upload apps. I wrote the CPAN module CGI::UploadEasy (not _only_ for
>> that reason...), which triggers a fatal error if it's feeded an
>> application/x-www-form-urlencoded POST request.
> Thanks again,
>
> I would like to check your module (whre can I get it?)
[url]http://search.cpan.org/perldoc?CGI%3A%3AUploadEasy[/url]
Not sure that it would help you as regards the script you bought, but
maybe your interest isn't directly related to that script.
--
Gunnar Hjalmarsson
Email: [url]http://www.gunnar.cc/cgi-bin/contact.pl[/url]
Gunnar Hjalmarsson Guest



Reply With Quote

