Errror in mod Image::magick or something else?

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. [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...
  3. #2

    Default Re: Errror in mod Image::magick or something else?

    Infochannel wrote:
    > 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.
    Then ask to have your money back. ;-)

    <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);
    > }
    <snip>
    > 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."
    If the problem would lie in a CPAN module, and not in the script, it's
    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?
    > Please see: [url]http://www.thepixelwars.de/maze/index.html[/url]
    Why? What has that page to do with it?
    > I've seen, that nothing is stored in the tmpdir, so its normal that
    > image::info gives that error.
    Faulty conclusion, since the failed check removes the file.

    --
    Gunnar Hjalmarsson
    Email: [url]http://www.gunnar.cc/cgi-bin/contact.pl[/url]
    Gunnar Hjalmarsson Guest

  4. #3

    Default 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

  5. #4

    Default Re: Errror in mod Image::magick or something else?

    Infochannel wrote:
    > Thank's,
    >
    > 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.

    --
    Gunnar Hjalmarsson
    Email: [url]http://www.gunnar.cc/cgi-bin/contact.pl[/url]
    Gunnar Hjalmarsson Guest

  6. #5

    Default 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

  7. #6

    Default Re: Errror in mod Image::magick or something else?

    Infochannel wrote:
    > 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?)
    At search.cpan.org, since it's a CPAN module. Direct link:

    [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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139