Images are not displayed

1,508 views
Skip to first unread message

Sebastian Roming

unread,
Apr 5, 2011, 5:05:37 AM4/5/11
to phonegap
Hi everybody,

i have an application that uses images as content.
There are twelve images each inside a div (#page_1 -> #page_12).

But when I launch the application on an iPad, sometimes some images are missing.
Some pages are displayed ok, but it could be that some pages are not
displayed and just a placeholder (on iPad the white questionmark on
blue ground) is displayed.

Every single image is in the list of preloading images.
Nothing is loaded through the web - all is packed with the app.

All Images are PNG-Files (1024x768px, between 400kb and 1 MB).


Any ideas to fix this? It's urgent :/

Nick McCloud

unread,
Apr 5, 2011, 6:13:09 AM4/5/11
to phonegap
You may of exceeded the memory that is available to the browser.

Try loading them dynamically in to one div section rather than loading
them all at the same time.



On Apr 5, 10:05 am, Sebastian Roming <sebastian.rom...@googlemail.com>
wrote:

Sebastian

unread,
Apr 5, 2011, 7:39:11 AM4/5/11
to phon...@googlegroups.com
Allright, that seems to be the problem. Didn't think about that :(

But the problem is, even if I do not load all images on startup but load them dynamically, they won't show either :(

Sebastian

unread,
Apr 5, 2011, 8:06:39 AM4/5/11
to phon...@googlegroups.com
Once they are loaded (whether they are loaded on startup or dynamically), can I leave them or do i have to remove them to load new images?

Because it seems, that when I leave them, it does not work :/

Giacomo Balli

unread,
Apr 5, 2011, 9:03:29 AM4/5/11
to phonegap
how big are they? 12 imgs should be handled fine by the ipad...

Sebastian Roming

unread,
Apr 5, 2011, 9:06:22 AM4/5/11
to phon...@googlegroups.com
As written in the first post:

> All Images are PNG-Files (1024x768px, between 400kb and 1 MB).

I updated now to 18 images. But that does not matter - even 12 are not
handled :(

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>

Giacomo Balli

unread,
Apr 5, 2011, 9:54:51 AM4/5/11
to phonegap
can you share some code on how you display them?
Seems weird...

On Apr 5, 3:06 pm, Sebastian Roming <sebastian.rom...@googlemail.com>
wrote:

Sebastian Roming

unread,
Apr 5, 2011, 10:02:49 AM4/5/11
to phon...@googlegroups.com
Sure, I can.
I reduced all images now to 1024x693px (full height is not needed)

www.sebastianroming.de/test/index.html.txt
and
www.sebastianroming.de/test/museum.js.txt


Maybe you can ignore the nested loading part, but I tried everything ;]

Sebastian Roming

unread,
Apr 5, 2011, 4:16:36 PM4/5/11
to phon...@googlegroups.com
Could you find a solution?

avoision

unread,
Apr 6, 2011, 10:39:24 AM4/6/11
to phonegap
I don't know if this matters, but I notice in your .html page that you
shift between using single and double quotes. Example:

<div id="page_2" class='page'>

I *don't* think this would be a problem, but just a thought. The other
thing I noticed was with the path to your images. Again, this might
not matter in terms of the syntax, but I've always used ../ to
reference a directory above, whereas I saw your image references do
this:

<img src='./images/flagUK.png' />

Since you're getting some good feedback here, I'm going to stop
commenting on the repeat question here:
http://groups.google.com/group/jqtouch/browse_thread/thread/8481cf4c31416fa5

Sebastian Roming

unread,
Apr 6, 2011, 10:44:08 AM4/6/11
to phon...@googlegroups.com
Thanks for your comment.
But as I mentioned in the other thread (you linked to), I built a
blank page with just images inside - and the images are not displayed.

So you do a reference like ../www/images/... ? Or how do you reference
your images?

avoision

unread,
Apr 6, 2011, 11:21:39 AM4/6/11
to phonegap
I always use ../ to reference a directory above the one I'm currently
in:

<img src="../images/flagUK.png" />

As I mentioned (in the other thread), I'm not familiar with developing
for the iPad development. One of the tests you tried was placing all
the images on a blank HTML page (no CSS, no JS). Even in that
scenario, you said that a few images would not load up. From the other
thread:

---------
Tried that - put all images on a blank HTML page - without javascript
or css implementation.
In the meantime I updated the number of images to #18 and on the
blank
page there are randomly 9 to 11 images displayed.
---------

So even on a blank, basic HTML page... 9-11 of your 18 images appear?
And it's random, as to which ones do and don't show up?

Given that, I'd suggest posting up the code to your blank HTML page.
If simply displaying the images isn't working, that suggests there's
something going on with your image paths... or that you're running
into the browser memory issue Nick mentioned, above.

If other devs feel this is a wrong direction to troubleshoot, please
let me know. Again, I'm not familiar with iPad... so I'm falling back
to very basic tests: get the images on a blank page, and go from
there. If you're unable to get all 18 to show up, try reducing the
number until you can see all the images. Maybe that might help verify
Nick's browser/memory concern.

Sebastian Roming

unread,
Apr 6, 2011, 11:35:20 AM4/6/11
to phon...@googlegroups.com
The images are randomly not displayed (on the blank html page), so
it's not the problem with the image path.

If I open the HTML in a browser, it shows all images up, but when I'm
loading within the app, it won't work correctly :(

avoision

unread,
Apr 6, 2011, 11:58:22 AM4/6/11
to phonegap
Ah, true - definitely not a path issue. Have you tried reducing the
total images, to see if you can get 10 images to consistently display?

At this point, I'll bow out. I feel like the more seasoned devs here
will be able to provide more input, but given your test results... I
wonder if Nick's browser memory issue is what's happening here.

Jesse Macfadyen

unread,
Apr 7, 2011, 6:00:46 AM4/7/11
to phon...@googlegroups.com
Make sure the images are NOT resources in Xcode otherwise the bundle
step will move them.

They should just sit comfortably in your www folder or a child of www.

Cheers,
Jesse

Sent from my iPhone

Sebastian Roming

unread,
Apr 7, 2011, 6:23:50 AM4/7/11
to phon...@googlegroups.com
They are not a resource of the app - they are only placed in www/images/iPad_1/.

Sebastian Roming

unread,
Apr 8, 2011, 5:08:12 AM4/8/11
to phon...@googlegroups.com
Still not working. No other ideas? Can't imagine why it does not work :(

Sebastian Roming

unread,
Apr 8, 2011, 8:10:53 AM4/8/11
to phon...@googlegroups.com
I notices, that I receive "Received memory warning. Level=1" message
in the Xcode Debugger Console.
Maybe that could help to handle the problem?

Sebastian Roming

unread,
Apr 11, 2011, 9:42:28 AM4/11/11
to phon...@googlegroups.com
FYI:
If the size of the whole /www/ folder is lower or equal than 6 MB -
everything works fine. But if the folder is 6.1 MB - some images are
not displayed.
Thats quite ugly, because I need a bit more than 6 MB.

How can I fix that?


On Fri, Apr 8, 2011 at 2:10 PM, Sebastian Roming

Reply all
Reply to author
Forward
0 new messages