One of the most useful applications of MT is to set up an online pictures diary and using all the in-built features for photosharing. Problem is that despite mt-check.cgi recognizing Image::Magick on your server, you cannot create thumbnails (you only end up with the dreaded 500 server error). Guess what, just as efficient as imagemagick are the NetPBM libraries and this little tutorial should have you working in no time.
So you have MovableType and cannot get it to support thumbnailing with either Image::Magick or with NetPBM? This is a tutorial to help you work with NetPBM,
Imagemagick is for another day. (PS: From my experience, there is no noticeable
difference in the operational efficiency or speed of using either, in case that
is what you were worried about).
So, let’s get cracking.
- First, you need NetPBM binaries. Many webhosts may have installed the libraries
but the binaries for NetPBM are small and cute, so it doesn’t really hurt
to have your own. Grab the NetPBM binaries from here.Note: This is in Windows ZIP format, if you need gzipped versions please write to
me, or grab them off NetPBM’s
website. - Unzip these files (they will create a NetPBM folder) and ftp the folder
to your web server. Let us say you upload them into your folder within your
MT folder as follows:/home/DOMAIN/www/mt/netpbm - Now, you need to set CHMOD all files inside netpbm to 755 (executable). Assuming you are into your netpbm folder,
chmod 755 *
- To make sure that the binaries are in proper order, try checking on some of the included binaries:
./jpegtopnm -version
or
./pnmcut -version
- Assuming that you see the info about the utils you tested (as above), we now need to make sure MT recognizes *your* NetPBM. TO do this, open your mt.cfg and modify the following two options:
ImageDriver NetPBM
NetPBMPath /home/DOMAIN/www/mt/netpbm - Upload your mt.cfg. Let’s check if MT can indeed find your NetPBM. From within your MT folder (one up from NetPBM folder), execute the following command in your shell — perl -Iextlib -MIPC::Run -e 1
- If you are lucky (and you should be, really, in most cases) then you are
all set — you can try the UPLOAD FILE from your MT now. If you have problems
here, let me know. It is usually related to IPC::Run but hopefully this shouldn’t be required.TIP: If you encounter IPC errors, ONLY THEN follow the next step. - Perform the following steps ONLY if you experience the IPC error outlined in step 7 —
- Get IPC files: http://sniptools.com/av/IPC.zip
- Unzip it, it will create an IPC folder.
- Upload the IPC folder as-is to your MT/extlib directory.
Time to start thumbnailing!
This post is tagged Tutorials

141 Comments
thanks! this was very useful for me, i have imagemagick working but couldnt get it to work with movabletype. i guess i will settle for netpbm. would be so nice if they could make their binaries a little more available!
No worries Craig. Where is your blog located?
Thanks for the clear instructions. I am still not able to get this to work, however…
I don’t know what I am doing wrong, as I have followed the instructions (many times over, in fact) and still can’t get it to work.
Currently, I am just getting a server error after I click the upload button. Never gets to the dialog box where I expect it should mention the thumbnail option.
Any ideas?
OK, I just ran the perl part from step 6 on my PC and got this error:
C:\sambar53\perl>perl -Iextlib -MIPC::Run -e 1
Can’t locate IPC/Run.pm in @INC (@INC contains: extlib C:/sambar53/perl/lib C:/sambar53/perl/site/lib .).
BEGIN failed — compilation aborted.
I installed the contents of the IPC.zip file in my MT/extlib directory and still get this same error message.
I’m starting to think that I am just not going to be able to do the thumbnails… :(
Kurt, looks like you are on Windows. I have thumbnailing running on Windows XP as well, so I am pretty sure it works.
I have some questions — 1. Do you have the netpbm binaries that are compiled for Windows: http://gnuwin32.sourceforge.net/packages/netpbm.htm
2. In your mt.cfg, what is the path you give to netpbm?
3. In your last message, you mentioned the IPC error, this has to do with Run.pm not being found. Can you try putting IPC::Run in your “perl/site/lib” folder as well? (This is kludgish but just to see if it’ll work)
1. I downloaded this file: http://prdownloads.sourceforge.net/gnuwin32/netpbm-10.6-bin.zip?download and unzipped it.
2. c:\sambar53\cgi-bin\mt\netpbm If you want to see my mt-cfg details, I have installed mt-medic at this address: http://198.109.164.98/cgi-bin/mt/mt-medic.cgi (The password to login to view the configuration is ‘yasgur’)
3. I just tried copying the IPC folder into the perl/site/lib and still get the same problem…
Thanks for the help! -=kt=-
OK, I hate to reply to myself, but I thought I would add this info:
I just tried uploading a 449 KB .jpg file, and got the server error (500), but if I selected a smaller file 22KB I get the normal dialog box asking me if I want to create a popup or embedded image. But not the thumbnail prompts. So, it seems I can upload smaller images but somehow a larger one causes some kind of error.
Maybe whatever is causing this error is also the cause of the NetPBM not working? I don’t know… I thought I’d add this since I just noticed this happening in case it might help you to help me! Thanks again for the help! -=kt=-
Kate, I tried visiting your medic site but the password is invalid. I guess I am not interested in the entire config you have going, but only the lines for NetPBM and thumbnailing. Let me try some stuff and see if I can come up with anything.
I set up my MT a month ago using these instructions and came back now because of all the kludgish workarounds, script tricks etc etc that go into making a photoalbum work with MT. If you ask me, it is just not worth it..even the thumbnaling because if I have 50 pics to upload, it gets awefully tiring to do them using the upload feature on MT. Much easier to just make them using a PS action and then let MT recognize them through the entries I create.
Come to think of it, it is definitely worth it to roll out your own little pic album script if you can find the time. Takes a max of 1 week or so but you are free from all the quixotic pixels (if you know what I mean) type workarounds.
Thanks for the thoughts. Yes, using mt for photoalbums soon gets pretty tiring. But for people who don’t know (or don’t want to know) coding themselves, it definitely helps to use mt or any other tool (e.g., PHP Gallery).
As for the thumbnails, that I agree with totally. After a while thumbnailing is a lot simpler without online “intervention”. But that would defeat the purpose of this page so I’ll try to find some ideas for Kurt anyway :-)
Hey, guess what??? After about the 1000th unsuccessful reinstall of NetPBM and IPC::Run, I finally decided to try the Image::Magick stuff again.
Took me a couple hours, but suddenly, out of the blue, mt-check said the magick
words!
Image::Magick…
Your server has Image::Magick installed (version 5.26).
I really have no idea what I did different this time, if it was a different version of the file or what, but Image::Magick is installed and seems to work! The only glitch I am suffering is related to my local site/archive paths in MT. My web files are on my d: drive and no matter how I configure things, the path MT creates for the thumbnail image includes the local path (d:/docs/blog…) in the middle of the URL. I can manually fix the URL before posting, so I’m considering it working!
Thanks again for the time and effort you gave toward helping me. I really appreciated the fact that you were willing to give me a hand, even though we don’t know each other!
Have a great day! -=kt=-
came to your page from mt forums, thx for the useful page. i got my netpbm working. can u aslo make the IPC file available in tar.gz so that linux users can also use it?
Thanks monastic, but I guess Linux users should be savvy enough to grab a valid IPC :)
Shashank — thanks a lot for this page. Came from the MT forums and got lost. Too many threads with dozens of opinions but on this matter but no intelligible solutions
I still have a big problem, though, it seems. After the thumbnail options, I get this error message: >>> Broken pipe: write( 14, […] ) at /usr/home29/hinrichs/public_html/cgi-bin/movabletype/extlib/IPC/Run/IO.pm line 582
Forgot to add:
Of course I changed the mt.cfg, too. :-)
Happiness is a warm blog
I’m happy for a number of reasons. I found out that [function+delete] does a forward delete on laptop keyboards and my friend mz_informed showed me a program called uControl that lets me set [function+touchpad-drag] like a mousewheel. The way i…
omg… thank you soO much for this page.. maN.. i could never get image::magick working.. and i could tell my admin was trying his very best to put up with all my emails.. until i found this.. i followed the instructions step by step and the darn thing finally works!! thank you so much.
i found this site via the MT forums. I followed your directions, but I do not get an option for thumbnails. I am at a loss here, any help would be greatly appreciated.
i spoke too soon. My NetPBMPath configuration setting was wrong. All is well. Sorry to have bothered you :)
thanks so much for your instructions. NetPBM now works on my webserver hosted externally. I still would like to know about ImageMagick since I checked and it is installed on the server as a Perl module. any idea when you will post instructions for that?
Oliver, I haven’t had the time to figure out why Image::Magick doesn’t work. It is installed on my systems too, but MT still refuses to recognize it. I can use Magick otherwise without a hitch so either it is an issue with Image::Magick the perl module (unlikely, I imagine) or with MT’s code (may be likely, given how many people have problems with it).
Will let you know if I choose to investigate it any further in the future, although doesnt seem likely to be honest.
Glad you got NetPBM working though (ditto for Ruthie).
Thank you so much for providing this tutorial!
I downloaded all kinds of different netpm packages, and none looked like what you provided with your zip-file here. I was totally confused what I needed to upload. Having wasted two hours, with your tutorial I was set within 5 minutes! Thank you!
now I have installed like your tutorial but I got this mesaage when I tried uploading some images.
MT::App::CMS=HASH(0x3f5708) Illegal character \015 (carriage return) at extlib/IPC/Run.pm line 1.
Please help me cause I need the possibility to creat thumbnails with my MT.
Thank you so much.
Cheers Eva
Eva, please follow the instructions on the 4th comment on this page which show you how to install your own IPC::Run stuff.
make sure you have downloaded the right netpbm for your server.. you can find what server your host is running at http://www.netcraft.com
TO find what server your host is running, our DIG A URL feature above is pretty useful as well. :)Just go to the top of this page, for instance, and enter your website. Lots more info than Netcraft website.
how do i execute
perl -Iextlib -MIPC::Run -e 1
i dont heve a shell access..
Is there anyway i can find if nt is calling netpbm lib ?
Install ActivePerl on NT and execute in your DOS prompt. ActivePerl: http://www.activestate.com
well but i can do that on my remote server? Whats the solution if i want to do it in the remote server.
If you dont have shell access, you can try executing that as a “system” command through Perl. Cannot help you much there, sorry. Let me know it goes.
so you are saying there is no way i can check if i my ipc::rum module is loaed well and runnin ??
Is there a script to check if the IPC::RUN module is installed in the Freebsd server., like the way mt-check.cgi performs the modules check ??
MT-CHECK should actually check IPC::RUN already.If you meant something other than that, sorry I don’t have the time to write it.
Hi there! Great tutorial, pretty idiot proof, but sometimes you know the evil machines just refuse to work.
Just a little clarification though, when
1)I execute the “perl -Iextlib -MIPC::Run -e 1” do I have to be in any particular directory to run that? And
2)For me I executed that line but nothing seemed to happened. I thought that was a good sign, until I tried uploading in MT and it didn’t offer me the thumbnail option.
Thank you. Regards.
Yes, execute that command in the MT/Extlib folder (it should even work from within MT folder though.)
If it does nothing, that is good. But if your MT still does not show the thumbnails, then get the IPC from my website as suggested in this thread (4th comment above). If you have followed the NetPBM instructions exactly as stated here, then give me another shout.
Hope it works out for you.
Hey there,
yeah I tried that but still no cookie. My server runs on Linux and I used a gzip file initially I found somewhere, and I tried the ZIP from above. Well, I think my arms are up and waving a white flag.
PS: I just realise it says “On July 27, 2003 09:44 PM thus >spake
Hey hey! Finally got it to work! I was trying to install gallery, and decided to put the netpbm files in the ~ directory of the site.
What happened before was I put netpbm in my MT directory. Try this just in case anyone else can’t get it to work. Regards.
I have followed all instructions both with the Netpbm and IPC::Run. However, i am still not getting the create thumbnail option when uploading a file.
Maybe a stupid question, but do i have to re-build MT or something?
At the moment i am recieving no errors so i have no pointers to give.
MT-Check isn’t checking IPC::Run as Shashank suggested before, so i can’t even confirm if this is working either.
One question: I am presuming my host doesn’t have Netpbm (and therefore the libraries you mentioned), so is it right for me to just install the binaries as directed above or do i need more?
nosa, what happens when you execute the commands suggested in step 4 above? feel free to include the output here (or send it to me by email)
also, tell us your folder structure. for lyrrad, the gentleman who posted above you, it seems paths were crucial.
Hello.
I’ve come here from the MT support forums too. Many thanks and congratulations on a well written tutorial (and site!).
Unfortunately, I’m having the same problems as nosa: I’ve installed NetPBM under my ..www/mt/netpbm directory with the correct permissions, and I’m not getting the create thumbnail option at all now.
I don’t have shell access to my webserver, so I can’t verify that libraries work properly by running the command line suggestions in point 4. mt-check doesn’t specify anything about IPC::Run either.
Its rather frustrating since the reason I’m trying to setup NetPBM is that the default MT setup with ImageMagick doesn’t work. I’ve spent hours scouring the MT support messageboards, but despite many people reporting the same problem, the only hint of a resolution was to use NetPBM (with a link to this post).
I’ve to’d-and-fro’d with my webhost on this. They claim both ImageMagick and NetPBM are installed correctly on their Linux servers. But the “out-of-the-box” MT setup causes Apache to throw a 500 Internal Server error when trying to use the create thumbnail feature. Pointing mt.cfg at the main NetPBM install (under /usr/local/)only throws the same error. Notably, I get the option to “create thumbnails” in _both_ cases.
Alas, after following your instructions, I no longer even get this option.
Any ideas?
Ben,
Thanks for the kind words. I can only offer a couple of suggestions/notes — (1) You say you dont have shell access. Without executing the NetPBM or IPC::Run, it is kind of difficult to figure out what is going wrong. Could you perhaps ask your host to execute the two commands inside the correct directory on your server and let you know the output? I believe it is a reasonable request.
(2) Secondly, don’t let your difficulties with NetPBM keep you from thumbnailing on your MT website. You’ll soon realize (after you have used MT for a while) how painful the thumbnailing stuff is, it is really a lot more productive to just KNOW your folder structure and use Adobe PS or Paintshop to do auto thumbnailing (you can create batch jobs in PS for example) and just upload the stuff in to the right folders, and then use whatever MT templates you are using, e.g., the QuixoticPixels template.
Let me know how it goes.
I don’t understand the step (6)Upload your mt.cfg. Let’s check if MT can indeed find your NetPBM. From within your
perl -Iextlib -MIPC::Run -e 1
What am I suppose to do with this? I download all the required file and upload all the necessary file to my hosting server accordinly to the instructions but still can’t see the thumbnail option.
Hi Sam,
I have changed the instruction to be a little more specific.
Basically, you can execute that line in your shell from your MT folder (one up on NetPBM). For instance, this folder:
/home/DOMAIN/www/mt/
Hope this helps. Thanks for pointing out the half-baked instruction.
Hi,
Thank you for the help. Sorry I don’t know what do you mean by “shell”. Should I execute it by “http://www.mydomain.com/movable/perl -Iextlib -MIPC::Run -e 1 ?. Thanks
Can you telnet into your domain account? “Shell” referes to the Unix/Linux shell. On Windows, it would be your MS DOS prompt. Anything that lets you execute commands on the server. So once you telnet (or if you have access to execute commands on the server) then get into the directory where you installed MT, and execute that command there.
Hi Shashank,
Thank you. Is it necessary to run that command in order to get the module function?
I used to install other modules which my hosting server doesn’t have in the extlib and it’s works fine but this one seems not working.
No, this command is only to check that IPC::Run is working without any hiccups. If you cannot run it, thats ok as long as you see the thumbnails option in your MT. If you dont see the option, then you may want to figure out a way to run this command or ask your host to run the command for you. Let me know how it turns out.
Hi Shashank,
Thank you very much for the help. I saw in the NetPBM’s website that the download file that you provided are categorized as an old type. May it does’nt work with Perl version 5.006.
I noticed there are many download version, very confused which one to download. My hosting server using Perl version 5.006. on windows 2000
You’re welcome Sam. Unfortunately stuff like this is trial and error. If you get it working, please consider posting the info here along with your environment. FWIW, I have NetPBM working on my Windows XP machine with Perl 5.8. Cheers.
Shashank, Ok let go through again on the setup routine on these IPC and Netpbm stuff.
1. Download the Netpbm binaries file (follow your link)
2. Upload it into the mt folder(in may case it’s movable/netpbm)
3.Download and upload the IPC folder into the Extlib folder
4.Changed the MT.cfg file in these two lines -
ImageDriver NetPBM
NetPBMPath /home/domain/www/movable/netpbm
Is there anything I left out? Can’t seems to get it to work….lol stranged!.
This thread and your help is very much appreciated. I’ve learned a lot but still have resolved my particular problem. I am pretty much a novice with Perl, and may be doing something obviously dumb, but I have tried a lot of combinations and still no change.
When I try to run upload an image I get the following message:
>>Can’t locate auto/Image/Size/jpegsize.al in @INC …. at … (my directory info)/cgi-bin/movable/extlib/Image/Size.pm line 233
… followed by …
MT::App::CMS=HASH(0x8367258) Can’t locate auto/Image/Size/autosplit.ix in @INC … /cgi-bin/movable/extlib/Image/Size.pm line 26 — — — — — — — — — -
It turns out that the image file has actually been copied into the target directory before this message appears. I am not especially concerned about thumbnailing - but I can’t get past this message to manage the images within entries, etc.
You said: >>it is really a lot more productive to just KNOW your folder structure and use Adobe PS or Paintshop to do auto thumbnailing (you can create batch jobs in PS for example) and just upload the stuff in to the right folders, and then use whatever MT templates you are using
Thanks in advance for any suggestions you might have.
Sorry to double-post, but I hit the “post” key too quickly:
You said: >>it is really a lot more productive to just KNOW your folder structure and use Adobe PS or Paintshop to do auto thumbnailing (you can create batch jobs in PS for example) and just upload the stuff in to the right folders, and then use whatever MT templates you are using
Rich, are you using Image::Magick, or NetPBM as described in this tutorial? “Image/Size.pm” should be involved only if you are using ImageMagick.
I am not using ImageMagick. My ISP has NetPBM installed and I have installed it - for good measure - on my local directory as well, as per the instructions here. I just re-confirmed that my mt.cfg file specifies the NetPBM driver and path.
Any idea what might be calling Size.pm if not ImageMagick?
To follow up on te idea that Size.pm relates to ImageMagick - I tried moving the file out of the Image folder in the cgi-bin directory. Then - trying to upload an image file - I got a new message that MT requires the Perl module to get picture dimensions. And refers to the installation instructions to load it. The installation instructions talk about loading Size.pm independent of using ImageMagick - so I didn’t get the connection.
So it looks as though I’ve missed something in telling MT that I’m not using ImageMagick and that I am using NetPBM - and therefore, apparently don’t need Size.pm?
Am I making sense? Have I missed a setting somewhere?
Rich,
If you have “ImageDriver NetPBM” in your mt.cfg, then it should be using NetPBM, no worries. As for the message, I am not sure what is driving it. I can only suggest you to redo the steps in this tutorial once again, one by one. You really should not be getting error messages in your “extlib/Images” folder, we have set up NETPBM inside the mt folder itself. Keep me posted.
Thank you for your trouble - I will continue looking.
In the meantime, can you tell me about the proces for manually loading a pic? Into which file can it be loaded so it isn’t wiped out by the next update?
Thanks again - I’ll let you know when I get this figured out - in case someone else has a similar problem later.
Thanks for this extremely usefull page!
I followed the instructions, but I keep getting the error 500 page (which I got when I was trying to use ImageMagick too).
My info:
Uploaded the NetPBM stuff from your zipfile in /home/flabber/public_html/netpbm/
Chmodded it all to 755.
Then I got the error that IPC was missing, so I installed IPC::run with CPAN.
Running “perl -Iextlib -MIPC::Run -e 1” then resulted in nothing, so that’s good, right?
Then testing creating a thumbnail resulted in an error 500.
I uploaded the IPC stuff to /home/flabber/public_html/extlib/IPC/ just to be sure on the IPC part.. Didn’t help.
My entries in mt.cfg:
ImageDriver NetPBM
NetPBMPath /home/flabber/public_html/netpbm
Thanks in advance for your reply!
hmm… i seem to be getting the same error as Greenlander
i get the thumbnail option to show up now, but when I hit “popup” or “embed” the next screen i see is:
Broken pipe: write ((gibberish gibberish gibberish lots and lots of gibberish))
at extlib/IPC/Run/IO.pm line 582
any thoughts? thanks
(1) Which version of MT are you using? I will assume the latest given that it is free anyway.
(2) Which IPC run are you using? The files from the fourth comment here ( http://sniptools.com/av/IPC.zip ) should work on your system. Please run the test again.
Let me know how it goes.
hi,
i’m running Version 2.64 of MT
i just re-installed the IPC you site there in my extlib directory and i’m stil having the same problem - still getting that weird “broken pipe” error
thanks for your help on this
Hi. After many attempts at Image::Magick, I gave up even though my webhost swears it works for others. I came upon your tutorial for Netpbm in Movable Type forums. Your instructions were helpful and I finally got it working, but I have some comments which may help you and other Movable Type users.
1. I wasn’t sure if the Netpbm binaries you are distributing would on a linux server, since the instructions don’t give details. They do. The Netpbm website (which you have linked) will point you to a dead link for the “official” linux distribution.
2. I tried putting the Netpbm folder under the /mt folder on my server, but for whatever reason, that did not work. So, I just put the folder under /public_html with success.
3. My host (Dayana Host) apparently did not have IPC::Run installed, or it could not be found by MT, so I installed it under /mt/extlib with success. Perhaps you should include instructions for downloading and installing IPC::Run in the main text of your tutorial. Right now, the details are in the comments. This is probably a common problem rather than an exception.
4. Finally, one thing that is not made clear anywhere until you notice it yourself… when using Netpbm (and probably the same with Image::Magick), you will be creating new image files which are the thumbnail images, and they will take up space. Folks need to keep this in mind as using thumbnails can eat up your disk quota. This might seem obvious to the experts among us, but it was not obvious for me until I noticed how much extra disk space I was using. Also, the Netpbm and IPC::Run files take up space too!
Many thanks for your tutorial.
Thank you so much for the very informative post, James! Much appreciated. Will move the IPC instructions into the main tutorial, guess its high time. Cheers!
I had the problem where ImageMagick appeared installed, but wouldn’t work. A few others appear to have encountered it as well.
Solution:
You need to install the perl-ImageMagick rpm. I installed this, yelled, “Thumbnail options, show thyself!” and I had instant gratification!
As I’m using apt-rpm, all I had to do was type:
apt-get install perl-ImageMagick
Hope that helps anyone who’s trying to get those thumbnails working!
I actually meant ImageMagick-perl! Whoops.
Thanks so much for this article. My photoblog finally works thanks to you!
I must be doing something wrong. I upload NetPBM to my Public_Html directory, CHMOD everything to 755, changed my MT.cfg settings to:
ImageDriver NetPBM
NetPBMPath /home/myusername/public_html/netpbm
Nothing works. The thumbnail option isn’t showing up in my File upload window in MT. What am I doing wrong?
I was having the ‘Broken Pipe’ problem described above until I went to the Gallery site (http://gallery.menalto.com/index.php) and found the precompiled binaries for freeBSD, which my host runs.
I can create thumbnails for images under 64k in size. Bigger than that and I get…
Resource temporarily unavailable: write( 9, ‘…’ ) at extlib/IPC/Run/IO.pm line 582
Has anybody seen or fixed this problem?
I thought the ‘resource temporarily unavailable’ problem might be related to using pipes in the IPC::Run package.
To test this, I made changes to MT’s Image.pm so that the NetPBM package wrote all of the intermediate results to temporary files instead of using pipes.
These changes are under package MT::Image::NetPBM
In sub init …
changed
IPC::Run::run(\@in, ‘{file} ? \undef : \$image->{data}), ‘|’,
\@out, \$out, \$err)
or return $image->error(MT->translate(
“Reading image failed: [_1]”, $err));
to
IPC::Run::run(\@in, ‘{file} ? \undef : \$image->{data}), ‘>temp1’);
IPC::Run::run(\@out, ‘temp2’);
open (TEMP, “;
close(TEMP);
In sub scale …
changed
if ($type eq ‘gif’) {
push @quant, ([ “${pbm}ppmquant”, 256 ], ‘|’);
}
IPC::Run::run(\@in, ‘{file} ? \undef : \$image->{data}), ‘|’,
\@scale, ‘|’,
@quant,
\@out, \$out, \$err)
or return $image->error(MT->translate(
“Scaling to [_1]x[_2] failed: [_3]”, $w, $h, $err));
to
if ($type eq ‘gif’) {
push @quant, ([ “${pbm}ppmquant”, 256 ]);
}
IPC::Run::run(\@in, ‘{file} ? \undef : \$image->{data}), ‘>temp3’);
IPC::Run::run(\@scale, ‘temp4’);
if ($type eq ‘gif’)
{
IPC::Run::run(@quant, ‘tempq’);
IPC::Run::run([“cat”], ‘temp5’);
}
IPC::Run::run(\@out, ‘temp5’);
local $/=undef;
open (TEMP, “;
close(TEMP);
In my case, the temp files are wirtten (by default) to my MovableType installation directory (where my MT .cgi files are).
There may be an easier way to fix the real problem or cleaner ways to make these changes, but this seems to be working for me and for images over 64k in size.
Also, since the NetPBM download included ‘pngtopnm’ and ‘pnmtopng’, I added ‘png’ file support by changing sub init
from
my %Types = (jpg => ‘jpeg’, gif => ‘gif’);
to
my %Types = (jpg => ‘jpeg’, gif => ‘gif’, png => ‘png’);
REPOST
I thought the ‘resource temporarily unavailable’ problem might be related to using pipes in the IPC::Run package.
To test this, I made changes to MTs Image.pm so that the NetPBM package wrote all of the intermediate results to temporary files instead of using pipes.
These changes are under package MT::Image::NetPBM
In sub init …
changed
IPC::Run::run(\@in, '<', ($image->{file} ? \undef : \$image->{data}), '|', \@out, \$out, \$err) or return $image->error(MT->translate( "Reading image failed: [_1]", $err));to
IPC::Run::run(\@in, '<', ($image->{file} ? \undef : \$image->{data}), '>temp1'); IPC::Run::run(\@out, '<temp1', '>temp2'); open (TEMP, "<temp2"); $out = <TEMP>; close(TEMP);In sub scale …
changed
if ($type eq 'gif') { push @quant, ([ "${pbm}ppmquant", 256 ], '|'); } IPC::Run::run(\@in, '<', ($image->{file} ? \undef : \$image->{data}), '|', \@scale, '|', @quant, \@out, \$out, \$err) or return $image->error(MT->translate( "Scaling to [_1]x[_2] failed: [_3]", $w, $h, $err));to
if ($type eq 'gif') { push @quant, ([ "${pbm}ppmquant", 256 ]); } IPC::Run::run(\@in, '<', ($image->{file} ? \undef : \$image->{data}), '>temp3'); IPC::Run::run(\@scale, '<temp3', '>temp4'); if ($type eq 'gif') { IPC::Run::run(@quant, '<temp4', '>tempq'); IPC::Run::run(["cat"], '<tempq', '>temp5'); } IPC::Run::run(\@out, '<temp4', '>temp5'); local $/=undef; open (TEMP, "<temp5"); $out = <TEMP>; close(TEMP);In my case, the temp files are wirtten (by default) to my MovableType installation directory (where the MT .cgi files are).
There may be an easier way to fix the real problem or cleaner ways to make these changes, but this seems to be working for me and for images over 64k in size.
Also, since the NetPBM download I found included ‘pngtopnm’ and ‘pnmtopng’, I added ‘png’ file support by changing sub init
from
to
MERCI UN MILLE FOIS.
THANK YOU A MILLION TIMES.
(and of course, english is my first language. but thanks anyways. and sorry for shouting, but the internets a big place.)
this worked like a charm! I love the Web! Just search and you shall find…
I’ve followed all your advice, including the intallation of IPC::Run. I now get the error
exec failed: Text file busy at lib/MT/Image.pm line 151 at lib/MT/Image.pm line 151
when trying to upload a file with thumbnails. This is a huge improvement on the server error, but I must admit that I’m mystified at this stage! Any advice on what to troubleshoot next?
By the way, this is a fantastic resource! Thanks!
Sorry to post again - I thought I should add that I only get the error message when trying to include thumbnails.
Ignore my last comment - I have it working now - and it works beautifully! Thanks so much!
Hi swf, thanks for that useful change. I’ve installed NetPBM to work with MT on several machines and never faced that problem, but sounds good! Thanks, Shanx
Most excellent.
I’ve never been able to get Image Magick working with MT, but this did the trick.
Fantastic :)
Cheers mate, you’ve sorted me out!
thanks, ill be sure to link you on my blog :)
Thumbnails, ImageMagick and NetPBM
Well, my host decided to change their installation of ImageMagick, the software that Movable Type uses to generate it’s image thumbnails. No thumbnails for me. So, I went in search of a solution, and found that MT can use an…
Ive tried everthing, seriously. But still doesnt work for me
I still get 500.
I never though I was THAT stupid.
Kathie, tell us about your OS, version of MT, hosting platform etc.
I have Windows XP, I use MT v. 2.64 and Im hosted at Netrillium. If you wanna see my site it’s http://memento — mori.org The place where I installed MT though is http://memento — mori.org/photo
Kathie, I did not mean what OS you personally use, which OS you are hosted on would be the useful bit of info. Assuming it is Windows XP,
(1) Have you followed all the steps outlined in this tutorial?
(2) Did you download the correct Netpbm libraries? (For Windows, that is?)
(3) What is the error you get? Do you have “Shell” access (Telnet/SSH) that’d allow you to execute commands? E.g., what error do you see when you execute step 4 in the tutorial?
Let me know. It should not be so difficult to sort out. Btw, I love the mast pic on your website!
Well you know what? I dont even know how to do the shell thing
Maybe if you could tell me? I mean… do I do that with my FTP prog or something else?
Hi - I’m a newbie to blogging and MT and am trying to install this software (which I’ve done) but I don’t understand how to chmode to 755 and wonder if someone could walk me through that (sorry for such a naive question in the midst ofthis sea of knowledge lol!)
Thanks (in anticipation!) annette
annette, in your telnet shell, just go to the directory where the files are, and then do the following:
chmod 755 *.*
The “*.*” is the same as on any OS, it is a wildcard that means all files. If you don’t want all files then just specify the files you wish to change the mode for.
If you don’t know what a telnet shell is, then even in your FTP software you may be able to just select the files on the server, then “Change Mode” or anything such. Most modern FTP software will allow for this.
Please let me know if you have any questions.
Just writing to say THANK YOU THANK YOU THANK YOU.
This information was very hard to come by. If you hadn’t taken the time to post this, I’d still be lost.
I had the IPC error and uploading the files you suggested worked perfectly for me. It took about 5 minutes after finding your page to get thumbnailing to work - and I had previously fought with ImageMagick for several days with no luck… You rule, that’s all.
Thanks for a CLEAR set of instructions, I’m not a server expert like many that use this and I was feeling a bit lost trying to figure out Image Magik.
Does anyone have any examples of a good photoblog format? I’m trying to use a nice once from Quixotic.com, http://www.quixoticpixels.com/index.php?qp=photoblog
It uses ImageMagic but I’m going to try and integrate Netpbm here.
Thanks again!
Hi,
i would very much appreciate your help,
i installed the ipc package after getting the ipc-error but now i get this message:
perl -Iextlib -MIPC::Run -e 1
Can’t locate fields.pm in @INC (@INC contains: extlib /opt/KQperl/lib/sun4-solar
is/5.00405 /opt/KQperl/lib /opt/KQperl/lib/site_perl/sun4-solaris /opt/KQperl/li
b/site_perl .) at extlib/IPC/Run.pm line 1075.
BEGIN failed — compilation aborted at extlib/IPC/Run.pm line 1124.
BEGIN failed — compilation aborted.
I dont have any idea where this “fields.pm” should be or come from, do you?
Greetings Nana
Hi nana,
The good news is that this is not a grave issue, my guess is that it’s got something to do with your Perl version. Fields.pm is an important “pragma” for doing OOP in Perl. Can you run this at your shell prompt…
perl -v
…and let me know which version it is? Also, if you know, what OS (and version) are you using? Shanx
Hi Shanx,
thank you for answering so quickly, my computer crashed so i couldnt come back faster.
I ran the command and it gave me this:
this is perl, version 5.004_05 built for sun4-solaris.
Actually i am renting the serverspace and i dont know what system they are running.
Greetings Nana
Nana, your Perl version is borderline ok, as per the requirements according to MT. Actually, my bad, your first error message does say that it is Perl 5.00405)
I guess this is a message you may have to show to your server host, and ask them why you don’t have access to Fields.pm. It depends on how they may have compiled Perl on the server for you. Just FYI, the latest version of Perl is 5.8.3, which is a LONG way off from the Perl version you seem to have.
Let me know what they say.
Cheers, Shanx
MT Photoblog Thumbnailing Without ImageMagick
Problems using ImageMagick to generate thumbnails lead me to find a new way to process images in Movable Type…
I installed NetPBM to my MT configuration as per the instructions. I also installed the “IPC:Run” components.
Now when I upload an image file to my photoblog I get the MT dialog which asks if I want a thumbnail image in addition to the popup or embed choice. So far so good.
After selecting the thumbnail option, create a new entry and selecting the embedded image option and clicking OK, I got an error page with the following information…
++++++++++++++++++++++++++
An error occurred:
exec failed: Permission denied at lib/MT/Image.pm line 126 at lib/MT/Image.pm line 126 exec failed: Permission denied at lib/MT/Image.pm line 126 at lib/MT/Image.pm line 126
++++++++++++++++++++++++++
Any ideas as to why I’m getting this error?
I followed your instructions. My MT is installed in the cgi-bin, so I wasn’t sure where to put the NetPBM binaries so I put them in a folder /public_html/mt-static. I did chmod them at instructed. Uploaded as binary.
I put the IPC tools in the /cgi-bin/extlib/IPC directory, uploaded all as ascii.
When the software goes to make the thumbnail, I get this error:
MT::App::CMS=HASH(0x83593c8) Use of uninitialized value in length at extlib/IPC/Run.pm line 3197.
I uploaded the Run.pm file three times just to make sure it made it. Any idea what’s causing the error?
Matt, did you change your MT.CFG file to specify the paths of NetPBM (Step 5 of above article)?
Second, what do you see when you execute IPC testing command (Step 6 of above article) on your shell prompt?
Third, what happens if you download the more recent IPC files from CPAN?
Yes, I configured the MT.CFG file correctly. I do receive the option to make a thumbnail after I upload a picture.
I receive the following output:
Can’t locate IPC/Run.pm in @INC (@INC contains: extlib /usr/lib/perl5/5.6.1/i686-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i686-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .).
BEGIN failed — compilation aborted.
After I uploaded the new IPC files I no longer get the option to make a thumbnail. It seems to have disabled it somehow. :(
This is a fantastic tutorial. Thanks very much for writing it.
I’ve installed NetPBM in the httpdocs. I’ve also installed IPC after the thumbnailing didn’t work.
My worry now is that I’ve got the wrong version of NetPBM. When I used “dig this” at the top of the page, I get the following information:
Apache /1.3.27 ( Unix ) Python .org/’>mod_ Python /2.7.8 Python /2.2.2 mod_gzip /1.3.19.1a mod_perl /1.27 mod_throttle/3.1.2 PHP /4.3.2 Frontpage /5.0.2.2510 mod_ssl /2.8.14 OpenSSL /0.9.7c
So, as far as I know (and I don’t know much) my server uses Unix, specifically Apache. When I go to search for a NetPBM version for Apache or Unix, I cannot find one. Plenty of Linux, yes…
Is there anything else that I can do?
Btw, I did modify mt.cfg, as stated in the tutorial.
Any insight into this will be greatly appreciated.
Kinuk, do you get any errors with NetPBM? Just wondering: if it works why fix it with the latest version? What UNIX are you using — your web host should be able to tell you that. Once you know, just the the appropriate libraries from here for that OS (http://netpbm.sourceforge.net/). Apache has nothing to do with it.
Hello. Great tutorial. I have followed it too many times now and unfortunately no success
My environment:
OS: Redhat/Linux
Perl: 5.6.1
MT: 2.661
MT dir: /var/www/html/blog
MT.cfg in: /var/www/html/blog/cgi-bin
netpbm in: /var/www/html/blog/cgi-bin/netpbm
IPC in: /var/www/html/blog/cgi-bin/extlib/IPC
Using IPC version 0.75 I get nothing when I run
perl -Iextlib -MIPC::Run -e 1 in both the cgi-bin directory and the cgi-bin/extlib directory.
However, MT still does not display a thumbnail option when uploading files.
Using IPC verison 0.78 I get the following error:
Can’t locate IPC/Run.pm in @INC (@INC contains: extlib /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .).
BEGIN failed — compilation aborted.
Any suggestions for what I might try next would be greatly appreciated.
Thank you.
Hi Michael,
What happens if you move the whole IPC folder to: — > /var/www/html/blog/extlib/IPC
Let me know. Shanx
Well I moved IPC to /var/www/html/blog/extlib/IPC
and I can run perl -Iextlib -MIPC::Run -e 1 in both the /var/www/html/blog and /var/www/html/blog/extlib directories without error.
However, there is still no thumbnail option when uploading images in MT
Note: the extlib subdirectory was added to /var/www/html/blog merely to follow your suggestion, it previously did not exist
Maybe it would helpful if I described the contents of /var/www/html/blog and /var/www/html/blog/cgi-bin
/var/www/html/blog contains all the blog’s html, templates, style sheets and syndication feeds.
/var/www/html/blog/cgi-bin contains mt.cfg, cgi files, lib, tmpl, and well basically everything else.
Is there any chance that if my host has NetPBM installed elsewhere there would be a conflict and thus MT is bypassing the thumbnail feature?
Any further assistance/suggestions would be greatly appreciated.
Thanks. -Michael
Wow!!! It finally is working! Thanks for the tutorial!
Turns out I had to declare the path name to NetPBM from the root of server in the configuration file. Elsewhere in the file I only declare paths from the root of my account. Oh well, it works!
Glad to hear that Michael. The next thing I was going to suggest was to confirm your cfg file. Anyway, all that ends well..
for those of you who use netpbm & experience this after pressing “popup” or “embed” butto:
Broken pipe: write ((gibberish gibberish gibberish lots and lots of gibberish))
It’s probably because that programs like jpegtopnm fails to run (libraries linking problems). try do a ldd on jpegtopnm and you may see that it can’t find some libraries.
Grrr!
I’ve read the post, read all the comments, followed all directions.
I do not receive the IPC error, it’s just that nothing has changed in my upload options at all. Exactly the same. No option for thumbnailing.
I’ve changed my cfg file, I’ve set permissions on the binaries, I’ve done it all. Grrr.
The only thing I could not do was check the binaries in my “shell”. In fact, I don’t even know what that means!
Turns out my solution was the same as Michael’s. I thought I’d tried that, but I guess not! Path to NetPBM from the root of the server…
Thanks for this tutorial. I can’t wait to get going.
After reading this fine tutorial and doing it more than 40 times and reading everyone comments i give up
My MT refuses to show the Thumbnail option when i upload a image 
Just to get this clear i did install NetPBM in my public html directory (who is called simple “www”)and chmod it 755. My final path is this one:
/www/NetPBM
Next i have edited MT.CFG and changed the lines “ImageDriver NetPBM” (i simple removed the #) and changed the NetPBMPath to NetPBMPath /www/NetPBM/ (also removing the #)
Since i don’t have shell access i tried to do an upload of a picture… And them nothing
No Thumbnail option 
I checked if my webserve had IPC::Run perl module and since it doesn’t i have installed it on the /cgi-bin/MT/extlib/ folder having in the final this folder /cgi-bin/MT/extlib/IPC
And still nothing
I also have checked my full paht to my server (in this case /mnt/web_j/d40/s40/a000k508/www) and changed the NetPBMPath to /mnt/web_j/d40/s40/a000k508/www/NetPBMPath and still no luck 
I’m almost giving up and i hope some one can see what I’m doing wrong and tell me…
Btw, my MT version is 2.64. Thansk!
Yoto, what happens when you remove the last slash from your “NetPBMPath /www/NetPBM/” ?
Hi Shashank!
If i remove the slash i still don’t get the thumbnail option… i also did the same thing using full NetPBMPath /mnt/web_j/d40/s40/a000k508/www/NetPBM and it also didn’t show the option
Btw, thanks for you help :)
I wish I found this tutorial 10 hours ago. I’ve been sitting here all day frustrated beyond belief because I couldn’t get Image::Magick or my NETPBM file’s to work.
THANK YOU SO MUCH!!
Thanks for this! This site comes up nicely on Google when you search for Movable Type & NetPBM so found it easily and got it all working within five minutes!
Thanks from the UK!
Image::Magick on Windows and MT: As it said on the old Image::Magick Perl site the directory where the DLLs are located is finicky. Try copying all of the DLLs into C:\Perl\site\lib\auto\Image\Magick or just C:\Perl it should work fine
http://www.dylanbeattie.net/magick/debug.html
quite possibly it is the same issue with Unix as well, perhaps the executables must also be located in the associated directory. Just a thought.
I’ve been trying to get NetPBM to work on a Windows 2003 server. I have followed the instructions and I am receiving the following errors when I run #6:
Prototype mismatch: sub Socket::IPPROTO_TCP > vs none at C:/Perl/lib/Socket.pm line 395
Prototype mismatch: sub Socket::TCP_NODELAY > vs none at C:/Perl/lib/Socket.pm line 395
If I try to upload a picture in MT, this message shows under the two buttons for pop-up and embedded image.
Any ideas on what is causing this? Thanks.
Thanks for the great tutorial. Too bad I can’t check if MT find netpbm (no shell access).
So I installed IPC::Run as well. Still no luck.
mt-medic at least says the config is ok, the paths and permissions are fine as well.
MT 3.121 really ‘breaks’ a lot of things that have been working perfectly with MT 2.61 - including image upload and XML-RPC (I had to install SOAP lite - grrrrrr!).
Once again thanks!
Thanks for your perfect instructions. I just install it on Mt 3.121 with IPC folder. Every thing is fine and I have my Thumbnail as well. But at the bottom of the pop-up window, there is an unlimited line of errors like these:
Pseudo-hashes are deprecated at extlib/IPC/Run.pm line 2452.
Pseudo-hashes are deprecated at (eval 14) line 68.
Pseudo-hashes are deprecated at extlib/IPC/Run/IO.pm line 556.
extlib/IPC/Run/IO.pm line 563.
Pseudo-hashes are deprecated at extlib/IPC/Run.pm line 3003.
Any suggestions to solve this?
Thumbnailing with NetPBM and Movable Type
Tutorial NetPBM mit Movabletype Wer statt Image::Magick das Perl Modul NetPBM verwenden will wird hier glcklich werden……
Hi,
I read your very useful tutorial about MT and NetPBM. I’ve followed all the instructions, and now I get it to let me try and create a thumbnail, but when I click “pop up image” or “embedded image,” I get the Broken Pipe error that a few on the thread have gotten. Do you have any idea for a fix for this? Any help is greatly appreciated!
Thanks :) — Arthur Che
arthur.che@gmail.com
http:// http://www.arthurhungry.com /