Displaying jpeg files through apache server

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

normano
Forum Newbie
Posts: 10
Joined: Thu Nov 16, 2006 11:16 am

Displaying jpeg files through apache server

Post by normano »

Hi having a very strange problem, have had apache set up with mysql and php for a couple of weeks now in order to learn php databasing etc, thought everything was working fine, managed to make a few complicated(ish) scripts which run correctly. The problem came when I tried to dispaly jpeg files. Some wern't being recognised at all. Large ones were not completely drawing. One thing I have noticed is that the ones that don't draw at all have all been taking by digital cameras of varying names.

I'm confused, anyone have any ideas?

Thanks Ben
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

my first guess...permissions.
normano
Forum Newbie
Posts: 10
Joined: Thu Nov 16, 2006 11:16 am

Post by normano »

as in apache permissions? how do I change them?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

as in permissions on the files. The web user needs to have read permissions on the files.

you'll use chmod to change file permissions.

you can determine the files' permissions by changing the the directory they're in and using 'ls -la'
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

What is your OS?
normano
Forum Newbie
Posts: 10
Joined: Thu Nov 16, 2006 11:16 am

Post by normano »

xp prof media centre and i don't think its the permissions or it wouldn't half load the files.
normano
Forum Newbie
Posts: 10
Joined: Thu Nov 16, 2006 11:16 am

Post by normano »

Have talked to quite a few people about this now, best answer I've had is reinstall, think that's the way to go? Would be (incredibly) annoying if I went through that and it didn't fix it.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Reinstall what, Windows? That's ludicrous.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

What I would do is save your jpeg files as GIF and PNG (yes, both types) then try running your app with those images instead of JPEG images (as a benchmark). Next, I would load a static HTML page with images in them (all three types of images) and run them from the localhost to test if this is truly an apache thing or not.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

I'm still leaning hard toward permissions, I've heard nothing to steer me away from that yet....
normano
Forum Newbie
Posts: 10
Joined: Thu Nov 16, 2006 11:16 am

Post by normano »

tried the different types, ie the 3 mentioned, having converted them (the files which wern't loading) they do load, but only to a size limit (this is under the size of a 1024 by 768 wallpaper) Its loads the top up to a certain point (not totally sure what size this is) but fails to get all the way down the image, resulting in black towards the bottom.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Now load them in your browser directly (File -> Open -> <filename_of_image>. Does that change the behavior?

@Burr = I would tend to agree with except that the poster is on a Windows machine. Typically this results in open permissions by default. I'm not counting permissions out, I'm just thinking it might be something else.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

ok, so they all draw partially now? If so, then the permissions issue is out the window.

can you open the images with your browser straight from the filesystem....in other words file:///...

that won't pass through your web server and will help eliminate that as a potential issue. Can you open the images with another application and do they work there? Is this happening with one browser type but not another?

edit: quick draw mcgraw everah...quick friggin' draw mcgraw.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Everah wrote:Typically this results in open permissions by default...
save an image to your desktop then copy it to your wwwroot folder 8O ... I do this all the time and forget to grant permissions to IUSR
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

How, specifically, are you displaying these files? Is it through a script? Are you using GD to dynamically process them upon request?
Post Reply