Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

White Space within Image

Options
  • 09-05-2011 4:18pm
    #1
    Registered Users Posts: 627 ✭✭✭


    Hi Guys,

    I have an image which when displayed in the browser (FF4, IE8, Chrome) has white space at the bottom of it, so its cropped a little. When I right click it and save as, the full image is downloaded, the white space in the image is not in the downloaded version... Im mystified.

    I've attached an screen shot of the image in Firebug, and I've attached the downloaded image too, any help or suggestions appreciated.


Comments

  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    For one thing you're specifying a width and height which don't match the image. If you really want to do this it tends to work better when done with CSS (i.e. inside your 'style' attribute).


  • Registered Users Posts: 11,979 ✭✭✭✭Giblet


    The issue is that the image contains no white space when saved, but does when displayed in a browser, regardless of any properties set on it, I've verified this is the case as well. There's something wrong with the image. Have you tried opening it in a different editor and resaving it?


  • Registered Users Posts: 627 ✭✭✭rossc007


    Thanks for the replies,

    I'm actually pulling 2 images from a database and displaying them side by side, the first image renders fine, then I get this weird white space problem. I could understand if the image on the server had the white space in it once it was created, but as you can see it doesn't. Its not specific to one image either.

    Don't think its a CSS issue, when I opened firebug the browser re-sized the image to fit. I dont even know what to google!


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    rossc007 wrote: »
    Hi Guys,

    I have an image which when displayed in the browser (FF4, IE8, Chrome) has white space at the bottom of it, so its cropped a little. When I right click it and save as, the full image is downloaded, the white space in the image is not in the downloaded version... Im mystified.

    I've attached an screen shot of the image in Firebug, and I've attached the downloaded image too, any help or suggestions appreciated.

    How is it "cropped" ?

    On a web page, the only way you can "crop" an image is to have it a) as a background within an element or b) have it within an element that has a defined size and an overflow:hidden

    Just checking on your terminology.


  • Registered Users Posts: 627 ✭✭✭rossc007


    Hi Liam,

    Maybe Appears Cropped is the correct terminology! You can see from the firebug screen shot that white space has appeared at the bottom of the image, within the img tag. Any ideas?


  • Advertisement
  • Registered Users Posts: 9,060 ✭✭✭Kenny Logins


    That is very odd, the white bar across the bottom is definitely added by the browser (FF, Chrome), there must be a glitch in the file itself.

    I opened and re-saved it and it's fine now..


  • Registered Users Posts: 627 ✭✭✭rossc007


    Hi Kenny,

    Very odd indeed!

    The image on the server is fine, but when you display it in an <img> tag on a browser, it gets that space at the bottom. As I said every image I use has this same bug.

    I've done some more messing around with the image and that space is transparent, not white, not that it makes much difference though :confused:


  • Registered Users Posts: 9,060 ✭✭✭Kenny Logins


    I just opened the image directly in the browsers, to rule out a possible HTML or CSS issue and the bar was displayed, but not with the re-saved file. Odd.


  • Registered Users Posts: 627 ✭✭✭rossc007


    OK the plot thickens, I uploaded the attached image with the gap issue to imgur - http://i.stack.imgur.com/f7RSi.jpg

    The file displays correctly on imgur and when downloaded and viewed in a browser the problem is gone! The file is also 1kb smaller, so must be an problem with the file itself.


  • Registered Users Posts: 9,060 ✭✭✭Kenny Logins


    If you have a lot of images just run them through a batch process with no changes, just to open and re-save.


  • Advertisement
Advertisement