Using NetPBM

sean088

Joined: 2002-10-11
Posts: 2
Posted: Fri, 2002-10-11 13:51

Hello everyone, I've downloaded and installed Gallery, I've gotten everything working great! Love it so far...

I'm not sure if this is the right forum to ask this in, but here goes... I have another little app I want to write now... basically all I want to do us upload a file to my server, and create a thumbnail of it. Should be really simple and easy to do with Netpbm right?? :smile:

Well, to start off I just created a test.php page in the same folder as my netpbm binaries (I have the precompiled binaries since I can't get root access on the host). The test.php file looks like this:

<?
exec("jpegtopnm 1.jpg>sean.pnm");
?>

So I have a file, 1.jpg, in that folder and I want to convert it to sean.pnm. That doesn't return any errors, it creates a sean.pnm file, but it's 0k in size. This is the first time I've ever used netpbm, as well as the first time I've ever used exec() so I'm sure I'm doing something wrong.

If I can just get this to work, then I'm sure I can figure out the rest... Thanks!

-Sean

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Mon, 2002-10-21 02:16

Permissions?
Make sure the user that apache runs under has permission to write in the directory you're saving in. Since you're not saving the returned value from exec() into anything, you wouldn't know if it didn't write.

-Beckett (beck@beckettmw.com)

 
sean088

Joined: 2002-10-11
Posts: 2
Posted: Tue, 2002-10-22 15:56

I chmod'd the folders to 666 (everyone full access) and still didn't have any luck. :sad: I even tried to use GD, but I guess my host doesn't have it compiled into apache...

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Tue, 2002-10-22 20:31

666? Folders need to be executable. Try 777.