Problem with simple use of Perl Magick - Server Issue?
Posted: 2009-02-09T03:34:03-07:00
As requested (via PM from ‘Magick’) I am re-posting my question about the use of Image Magick in Perl. This problem is currently holding up a large community project. ‘Magick’, many thanks for taking a few seconds to give me an answer as promised, much appreciated!
I have given my host a link to this post so hopefully they will be able to read up on the issue and seek a resolution.
The problem here is that the 'READ' function of Imagemagick doesn’t seem to work for some reason.
My host says that Image Magick is running on the server and that I should have no problems.
If you could confirm that the code below should work on a server that has
Image Magick running it will at least eliminate the possibility that I am at fault.
This code is the minimum required to show my point. It should read an image in and write it out again. Unfortunately it doesn’t work.When running this code I receive the following error:
--------------------------------------------------
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@host.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------
If I comment out the 'READ' line the script runs through and prints 'Complete' to the screen but no file is written out.
My host suggested that I try changing the READ line to: $src->Read(-"../../source.png"); which does let the script run to completion, but no image is actually processed\loaded. So while it allows the script to run it doesn’t fix anything
If it's any use I to know, I have ftp access and limited cPanel access to my webspace\account but do not have any other direct server access of any kind and cannot run shell commands.
If there is anything my host should be aware of that would resolve this issue I would be extremely grateful if you'd let me know so I can pass on the info. They do currently assume that they support Image Magick even though I can't get it working.
Kind regards, and many thanks for your help.
I have given my host a link to this post so hopefully they will be able to read up on the issue and seek a resolution.
The problem here is that the 'READ' function of Imagemagick doesn’t seem to work for some reason.
My host says that Image Magick is running on the server and that I should have no problems.
If you could confirm that the code below should work on a server that has
Image Magick running it will at least eliminate the possibility that I am at fault.
This code is the minimum required to show my point. It should read an image in and write it out again. Unfortunately it doesn’t work.
Code: Select all
#!/usr/bin/perl
use CGI;
use CGI::Carp qw ( fatalsToBrowser );
use File::Basename;
use CGI qw(:all);
use Image::Magick;
print header;
my $src = Image::Magick->new;
$src->Read("../../source.png");
$src->Write("../../updated.png");
undef $src;
print q(Complete);
exit;
--------------------------------------------------
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@host.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------
If I comment out the 'READ' line the script runs through and prints 'Complete' to the screen but no file is written out.
My host suggested that I try changing the READ line to: $src->Read(-"../../source.png"); which does let the script run to completion, but no image is actually processed\loaded. So while it allows the script to run it doesn’t fix anything
If it's any use I to know, I have ftp access and limited cPanel access to my webspace\account but do not have any other direct server access of any kind and cannot run shell commands.
If there is anything my host should be aware of that would resolve this issue I would be extremely grateful if you'd let me know so I can pass on the info. They do currently assume that they support Image Magick even though I can't get it working.
Kind regards, and many thanks for your help.