iPhone Safari, png not supported

Discussion in 'iOS Development' started by Duykur, Mar 19, 2009.

  1. Duykur

    Duykur Banned

    Joined:
    Mar 24, 2008
    Messages:
    1,674
    Likes Received:
    0
    Hello,

    I just wrote some code so my application could show a webpage that consists of a png image. The image shows up on browsers outside of the iphone, but ths simulator does not render the image. Is the safari browser png capable or not, and is there a way to fix this.

    thank you.
  2. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    I am confused... are you using a UIWebView to show the page, or opening the URL in MobileSafari?
  3. Duykur

    Duykur Banned

    Joined:
    Mar 24, 2008
    Messages:
    1,674
    Likes Received:
    0
    both, i beileve it's memory limitations, but need more information
  4. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    I show plenty of pngs in UIWebViews. Clearly, there is something else in play here. We can not know how to begin helping you without more details or, preferably, code samples.
  5. Duykur

    Duykur Banned

    Joined:
    Mar 24, 2008
    Messages:
    1,674
    Likes Received:
    0
    The problem, i beileve is that the image is simply too large and cannot be rendered

    but it's a basic code
    Code:
    -(void)awakeFromNib {
    	[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://duykurapps.freehostia.com/diseasemap/h5n1.html"]]];
    }
    EDIT, the image being 137 KB should not cause a problem
  6. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Clearly, then, you can try this with a smaller image to see if it loads.

    I literally see so many places where your code can go wrong just from that tiny bit of code you've presented and assumptions about the rest of your code.
  7. Duykur

    Duykur Banned

    Joined:
    Mar 24, 2008
    Messages:
    1,674
    Likes Received:
    0
    Thanks for the help, [Fixed]
  8. Duykur

    Duykur Banned

    Joined:
    Mar 24, 2008
    Messages:
    1,674
    Likes Received:
    0
    Well can you give me some sample code on how to do a proper UIWebView
  9. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    I plan on writing up a tutorial showing all kinds of UIWebView goodies.

    One thing I've noticed is that the images take up substantially more memory while being loaded than they actually take up. I don't know why this is, but we must deal with it. The real downside is that we are severely memory restricted, and Safari isn't.

    I've yet to have this happen on anything though, which is why it is striking my as odd, as I've opened If you don't mind, I want to try to open the image up in one of my UIWebViews. Please, either post a link to the image, or if it needs to be kept under wraps, a similar sized image.

    Thanks!
  10. Duykur

    Duykur Banned

    Joined:
    Mar 24, 2008
    Messages:
    1,674
    Likes Received:
    0

Share This Page