...

View Full Version : Image Issue



john0000000000
05-02-2009, 11:32 PM
I'm not sure if this is the right forum but my pages are in php so here goes:

I am using xampp (latest version with php 5) as a testing server. I built a headless server to serve on my home network. Everything seems to be ok except my images. I use CSS to add background images to some of my DIV elements and the images come out garbled - weirdly shaded or mixed up colors. Next, some of the images come out cropped in half or only part of them seems to load. Some of the google research i did today suggests maybe a php.ini issue but i have no clue what to do.

I also have the same xampp install on a portable drive that I was using for testing and file serving and the same issue occured there. I eliminated my computer as the issue. I'm running 5 machines here and all of them display the exact same errors when I try to view the web pages.

So the issue has to be with either xampp or my php i'm guessing. Only thing is I have done all i know to do. Oh, if I upload the files to my web host the display as they should so it's not a file or image issue either.

Any help or a point in the right direction would be much appreciated

Thanks

timgolding
05-03-2009, 12:51 AM
Hi an image is an image when it is served from a webpage it is downloaded onto the users browser as a file, hopefully an exact copy of the file that is stored on the server. It is then cached on the users machine in a temporary folder. PHP is not responsible for how the image appears unless it is being served with headers (http://uk.php.net/manual/en/function.header.php). But you stated the the image is served via css therefore that is not the case. That's not to say that APACHE isn't screwing with the image in some way. Can you post on of these images here just to confirm that the images are OK? What type of image files are they?

I'm not entirely sure but scanning through my apache/httpd.conf file i found this

# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.

Maybe that has something to do with it?

john0000000000
05-03-2009, 04:46 PM
This is the original image which looks fine if i view it in photoshop or if i open just the image with a web browser:

http://i5.photobucket.com/albums/y189/mmcduffie1/header.jpg


This is the result if I pull the webpage up from localhost or 127.0.0.1 and let the server do its thing:

http://i5.photobucket.com/albums/y189/mmcduffie1/sdaily.jpg

Sometimes the images only partially load in addition to looking like this image

Edit: Also, if i open the web page directly from my browser and not let the server have anything to do with it - all the images load ok.

timgolding
05-03-2009, 08:45 PM
I don't know what is causing this problem other than a problem with apache. You could try disabling sendfile directive for those images. Something like this



<Directory "/path-to-files">
EnableSendfile Off
</Directory>


Put that in your apache/httpd.conf and restart apache

john0000000000
05-04-2009, 06:54 AM
I don't know what is causing this problem other than a problem with apache. You could try disabling sendfile directive for those images. Something like this



<Directory "/path-to-files">
EnableSendfile Off
</Directory>


Put that in your apache/httpd.conf and restart apache

That didn't work either :(
I checked with xampp and they said to update. So (i was one release back from the latest) so I got the latest. I completely removed the old xampp and all files associated with it. I set up the new server and so on. Now, the images that refused to laod at all are loading but they look like this:

http://i5.photobucket.com/albums/y189/mmcduffie1/sdaily.jpg

So they are still garbeled but they do load now. If I upload these exact same files to my we host (also an apache server) they work perfectly.

Note: My pages are not exactly PHP pages. I use the php extension since i use some php includes for navigation and my forms run off php. My pages are actually coded using html and i use css to make the pretty. Would that be an issue? Say a page with no actual php on it yet having the .php ext? It doesn't seem to be an issue for my web host and it's much easier to give them all the php ext so i dn't oops and give a page with php in it an html ext.

Thanks for the advice so far :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum