Updating a perl module fwith cpan
Then, I want to add scaling on-load to it, just in case if the user wants to scale an image a bit. You can not learn programming by copying code and by trail and error modify it.I replace "special comment" with this: if ( defined $fwidth && defined $fheight ) What I get is: Warning 310: no images to mogrify (Scale), and the image is not scaled. $err = $img- "$fwidth"."x"."$fheight"); Common::goboom("Can't scale image file: $err") if $err; Probably makes it work.Common is one of the worst names for a module, like Misc, Stuff, Tools, Utils, Useful, etc. Try to avoid putting "common" stuff in one module, but group functions, and give the module a useful name.Better, check CPAN, maybe you are reinventing the wheel.There are other books available that discuss Image:: Magick and other graphics packages, particularly in a Perl context.If the web site doesn't help you, maybe you should have a look at them.
Here's what I have sub read_image_file this one works completely.Becky wrote: To me it looks like I need 'cl'. Perl PPM NTLM module problem Is there something wrong with the NTLM module, or is it just my machine that somehow has a problem with installing it ?I have tried the command below, with the result as below: C:\tempppm install NTLM Downloading Active State Package Repository packlist..Updating Active State Package Repository database..Downloading NTLM-1.05..Unpacking NTLM-1.05..install failed: Can't extract files from C: \DOCUME~1\sven\LOCALS~1\Temp\ppm-r E4t9N/NTLM-1.05I have tried to uninstall perl, and then reinstalled the latest version (see below).I tried using scale with width-height, and removing 2nd scale too - it doesn't work... I bet you didn't check the value of $err, not understood the error you got (I hope / think Blob To Image would complain about $foo). $err and Croak "read_image_file: can't convert image data: $err"; Is a better way, compared to Common::goboom, although I have no clue how it's used (the code that is).The only difference I see is that there's Blob To Image before 2nd scale - I tried to insert my $foo; $err = $img- before it - didn't help either. Even better, let a function only complain if the programmer made an error in it's *usage*. return some error state, so the main program can decide how to handle it.