cancel
Showing results for 
Search instead for 
Did you mean: 

Getting a module added

UncleZen
Grafter
Posts: 83
Thanks: 6
Registered: 15-08-2008

Getting a module added

Hi, Im using the ccgi webpace for a home project. I need to find out the size of an image using Perl, to do this I need to use Image::Size but that module is not installed on the server.
is there somewhere I can request that it is installed?
TIA
5 REPLIES
prichardson
Grafter
Posts: 1,503
Thanks: 1
Registered: 05-04-2007

Re: Getting a module added

At this moment in time it is not currently possible.
We are smack bang in the middle of a review of the platform on what we should do for the future, as something we have recognised for a long time that the platform is far from suitable for future use.
As such, I feel your pain. There are many aspects of the service I too want improved to allow me to develop things, but I would also prefer the platform to have a long term future much more than to get the little bits I need right now.
The good news it there are often a workaround, but unfortunately there are aspects of Perl I hate because I just don't quite grasp them, so couldn't tell you where to start looking.
UncleZen
Grafter
Posts: 83
Thanks: 6
Registered: 15-08-2008

Re: Getting a module added

Thanks for the reply P Richardson. Straight fwd to the point and honest.
With software there are often many ways to achieve the same goal. Like you some of the Perl modules make no sense to me aswell. I'll keep looking for another way of doing what I want, besides its not the end of the world if I dont do it, it would just be nice.
Cheers
Prod_Man
Grafter
Posts: 286
Registered: 04-08-2007

Re: Getting a module added

I've never used Perl in my life,
But, PHP's GD Extension is there if you need it...
I assume Perl can run System Commands?
if so just tell it to run this PHP Script
imgwh.php

<?PHP
//Initialise
$X=0;
$Y=0;
$img='';
// Get File Extension
$Ext = explode('.',$argv[1]);
// Find File Type & Load
switch( strtolower($Ext[count($Ext)]) ){
case "png":
$img = imagecreatefrompng($argv[1]);
break;

case "gif":
$img = imagecreatefromgif($argv[1]);
break;

case "jpg":
$img = imagecreatefromjpeg($argv[1]);
break;

case "jpeg":
$img = imagecreatefrompng($argv[1]);
break;
}
if($img != ''){ //if the resuls is not empty, it has loaded...
$X = imagesx($img);
$Y = imagesy($img);
echo $X. ','. $Y; //output image dimensions
}
?>

imgwh

#!/usr/local/bin/php imgwh.php $*

It should then work, something like this
#> ./imgwh myfile.png
320,240
#>
Then, use perl to Execute, take in the Data and separate by the Comma...
Hope that helps!
Jim,
oliverb
Grafter
Posts: 606
Registered: 02-08-2007

Re: Getting a module added

Its possible to install your own modules.
Too much to post here but I'm trying to write up the procedure, basically you create a library directory under your cgi-bin (or at least thats where mine is) and a ".cpan" directory under your home, then you can just run the cpan shell and install stuff from cpan.
Otherwise you can probably get the image size functionality from GD as the Perl GD modules are installed.
oliverb
Grafter
Posts: 606
Registered: 02-08-2007

Re: Getting a module added

Quote from: P
The good news it there are often a workaround, but unfortunately there are aspects of Perl I hate because I just don't quite grasp them, so couldn't tell you where to start looking.

There appears to be a workaround package called local::lib which creates a local library directory in the user's home directory. From a brief initial look it appears that local::lib fixes several environment variables so that any perl module you try to install gets sent to your dir not the public one. The bodge I gave in my previous post only works for some modules, pure Perl modules only I think.
Incidentally the description of local::lib in cpan lost me, but the version on the catalyst homepage made sense I think.