Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Hacking Movable Type

by thpfft (Chaplain)
on Mar 31, 2003 at 13:58 UTC ( [id://246922]=note: print w/replies, xml ) Need Help??


in reply to Hacking Movable Type

imagemagick is extremely horrible to get right, and MT only require()s it as needed, so I'd assume that an installation glitch is likely and work at this one from both ends. First test your imagemagick installation from the command line:

$ convert ./my.jpg my.png

and then from a minimal script. If this works, for example, you can say with confidence that MT is broken:

use Image::Magick; my $infile = '/some/image/or/other.jpg'; my $outfile = '/some/image/or/other_thumb.jpg'; my $image = Image::Magick->new; my $check = $image->Read( filename => "$infile" ); die $check if $check; $check = $image->Resize( geometry => "50x50" ); die $check if $check; $check = $image->Write( filename => "$outfile" ); die $check if $check; undef @$image; print "ok\n";

Meanwhile, and assuming that nothing useful comes out of all that, you need to isolate the thumbnail-shrinking part of MT (which is in ./lib/MT/Image.pm) and, as tachyon suggests, fill it with warn statements and watch the logs. Note the odd way that IM returns errors above, for example, and drop that code into the right bit of MT along with lots of statements that tell you what filename it's trying to open and why it thinks that's a good idea.

You may even find that MT has a verbose toggle somewhere that will do this for you.

 

update: I tried to investigate properly but it just works here, which is annoying :).

I did learn two things, though. FIrstly that MT has some weird stuff going on with paths and it's worth double-checking all that, and secondly that MT consistently signals failure by returning an error object. The quick and dirty way to see what's going on would be to add this to MT::ErrorHandler after line 14:

warn $msg;

or for the maximum debug-fountain:

# at the top use Carp qw/cluck/; # in sub error again: cluck $msg;

good luck.

Replies are listed 'Best First'.
Re: Re: Hacking Movable Type
by nysus (Parson) on Mar 31, 2003 at 17:29 UTC
    Yeah, I think you are on to something with the configuration of Image::Magick. I keep getting this error:
    perl: constitute.c:2015: ReadImage: Assertion `image_info->signature == 0xabacadab' failed.
    when Image::Magick gets called by Perl.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks

      I've never seen that particular error, but if the command-line tools work and the perl tools don't, it's nearly always because the installations of Imagemagick and Perlmagick don't match.

      If you installed IM from the source, try installing the version of Perlmagick in the same package, with a configuration that corresponds to what you used for IM. If you didn't, then may Allah smile upon your unworthy brow, for you are about to start :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://246922]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-03-29 06:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found