[SOLVED] Netpbm files created but as 600

saltcity

Joined: 2005-05-11
Posts: 8
Posted: Wed, 2005-05-11 03:51

I just installed Gallery 1.5, with netpbm from netpbm_gallery-1.4-pl2-linux-intel.zip. When I upload images, they come across fine with attributes 664. Netpbm is creating the thumbnail and resized images just fine, except that the file attributes are 600 instead of 664. In Gallery, it shows the images as broken links. If I manually chmod the attributes to 664, they work just fine.

Here is debug output... nothing much to see here.

******Adding 000_0406.JPG*****

Doing the naming
Image Preprocessing
Resizing/compressing original image
Resizing Image: /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg
Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg
No resizing required
Adding Photo to the photo list
File /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg type 2.

Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg
Generating thumbnail.
Resizing Image: /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg
Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg
Executing:
'/home/content/l/a/n/landrum/html/netpbm/jpegtopnm' '/home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg' | '/home/content/l/a/n/landrum/html/netpbm/pnmscale' -xysize 150 150 | '/home/content/l/a/n/landrum/html/netpbm/pnmtojpeg' --quality=90 > '/home/content/l/a/n/landrum/html/albums/album01/000_0406.thumb.jpg'

Results:
none

Debug messages:
jpegtopnm: WRITING PPM FILE

Status: 0 (expected 0)
Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.thumb.jpg
Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.thumb.jpg
Resizing Image: /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg
Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg
Executing:
'/home/content/l/a/n/landrum/html/netpbm/jpegtopnm' '/home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg' | '/home/content/l/a/n/landrum/html/netpbm/pnmscale' -xysize 200 200 | '/home/content/l/a/n/landrum/html/netpbm/pnmtojpeg' --quality=90 > '/home/content/l/a/n/landrum/html/albums/album01/000_0406.highlight.jpg'

Results:
none

Debug messages:
jpegtopnm: WRITING PPM FILE

Status: 0 (expected 0)
Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.highlight.jpg
Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.highlight.jpg
- Resizing 000_0406
Resizing Image: /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg
Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg
Executing:
'/home/content/l/a/n/landrum/html/netpbm/jpegtopnm' '/home/content/l/a/n/landrum/html/albums/album01/000_0406.jpg' | '/home/content/l/a/n/landrum/html/netpbm/pnmscale' -xysize 640 640 | '/home/content/l/a/n/landrum/html/netpbm/pnmtojpeg' --quality=90 > '/home/content/l/a/n/landrum/html/albums/album01/000_0406.sized.jpg'

Results:
none

Debug messages:
jpegtopnm: WRITING PPM FILE

Status: 0 (expected 0)
Getting Dimension of file: /home/content/l/a/n/landrum/html/albums/album01/000_0406.sized.jpg

 
saltcity

Joined: 2005-05-11
Posts: 8
Posted: Wed, 2005-05-11 04:13

I wonder if this problem is related to the /albums/.users/.htaccess file. I don't know much about it, other than it deals with rights of files. (Logically, I wouldn't think that this would affect the different albums since it is in a different directory)

Here is the contents of this file:

Order deny,allow
Deny from all

 
Jordan_01002

Joined: 2005-02-14
Posts: 1535
Posted: Wed, 2005-05-11 10:54
 
saltcity

Joined: 2005-05-11
Posts: 8
Posted: Wed, 2005-05-11 15:01

The first thing that I did was to review the FAQ and similar issues here in the discussion groups. I have already confirmed that the albums directory is set up correcly in the Gallery setup (according to FAQ #11). The reason that I don't think that this is a problem, is because the netpbm files are created in the correct directory. The problem is that they don't have the correct file attributes, making them visible to anyone but the FTP user.

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Thu, 2005-05-12 02:03

Can we get a URL?

 
saltcity

Joined: 2005-05-11
Posts: 8
Posted: Thu, 2005-05-12 18:03
alindeman wrote:
Can we get a URL?

I don't know that this will help much, but here you go.
http://www.bigbrotherconstruction.com/gallery

I have manually fixed the photos that were loaded so that the file attributes of the thumnails and resized photos appear OK.
=====

On a side note, I sent a message to Bryan Henderson, who supports netpbm, and here is his response about this issue:

bryanh@giraffe-data.com wrote:
Netpbm doesn't contain any controls for the file attributes; Netpbm's
output files are created and opened by whatever invokes the Netpbm
program. A netpbm program gets an open output file as input.

I don't know anything about Gallery, but I suppose in this case, it's
the PHP interpreter that is invoking Netpbm, and therefore creating
the files. I don't know anything about PHP either. I think you need
a Gallery expert for this.

 
saltcity

Joined: 2005-05-11
Posts: 8
Posted: Thu, 2005-05-12 21:21

Gallery URL (optional but very useful): http://www.bigbrotherconstruction.com/gallery
Gallery version: 1.5
Apache version: 1.3.31(Unix)
PHP version (don't just say PHP 4, please): 4.3.11
Graphics Toolkit: NetPBM
Operating system: Linux
Web browser/version (if applicable): MSIE 6.0

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Thu, 2005-05-12 22:08

Wild guess here, but try adding this line to the top of init.php, right after <?php

umask(0022);
 
saltcity

Joined: 2005-05-11
Posts: 8
Posted: Fri, 2005-05-13 00:55

Hmmm. That seems to have resolved it. Thanks! (What does that do?)

I don't know if it is a related error, or something completely different. But when I load a new photo, an IE browser error window pops up just as it is processing the photo. It won't proceed until I click "no". It has the following text...

A Runtime Error has occurred. Do you wish to Debug?
Line: 58
Error: 'statusWin' is null or not an object

What should happen is that the parent Window should reload and display the new photo. This new photo doesn't appear unless I reload the page manually. (Sounds like an IE JavaScript error)

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Fri, 2005-05-13 01:09

It sets the default permissions for new files, usually. Most people don't have as restrictive a default umask as you do though, so the problem isn't an issue most of the time.

I'm not sure about the JS error, but it sounds browser related. Do you have debug mode on or are you disallowing popup windows?

 
saltcity

Joined: 2005-05-11
Posts: 8
Posted: Fri, 2005-05-13 01:17
alindeman wrote:
I'm not sure about the JS error, but it sounds browser related. Do you have debug mode on or are you disallowing popup windows?

Ah, that is it. I have a popup blocker. Once I enabled popups, it works like a charm! I didn't even think about it since the second window for loading files also pops up.

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Fri, 2005-05-13 01:48

:) Kool