Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Image Issue

  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Image Issue

    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

  • #2
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    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. 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?
    You can not say you know how to do something, until you can teach it to someone else.

  • #3
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:




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



    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.
    Last edited by john0000000000; 05-03-2009 at 04:21 PM.

  • #4
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    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

    Code:
    <Directory "/path-to-files">   
         EnableSendfile Off  
    </Directory>
    Put that in your apache/httpd.conf and restart apache
    You can not say you know how to do something, until you can teach it to someone else.

  • #5
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by timgolding View Post
    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

    Code:
    <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:



    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •