# Dynamic loaded jpegs question

**URL:** https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797
**Category:** Uncategorized
**Created:** [October 16, 2002, 7:31pm UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797 "2002-10-16T19:31:33Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![dcell](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@dcell](https://forum.kirupa.com/u/dcell)
#### Post date: [October 16, 2002, 7:31pm UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797/1 "2002-10-16T19:31:33Z")

</div>

ok…here’s one for you brainiacks

I can dynamically load jpgs  
I can randomize the order of dynamically loaded jpgs

but…Is there anyway to dynamically count the number of images in an external folder?

ie: The app is a little picture viewer that stops advancing after the last image. But I have to let the app know how many images to display before stopping.  
I can do it with an external txt file or XML, but I don’t want to do that. Clients are to lazy to learn.  
So if I put 8 iamges in a folder one day, it works as described, and if I put in 10 more images the next it still works the same.  
All without having to do anything at all except putting in more images in a folder.

Does that explain it clearly enough and does anyone know how to do this?

Thanks  
David

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 17, 2002, 10:26am UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797/2 "2002-10-17T10:26:33Z")

</div>

Hi,

I would approach it from the other side:

Instead of trying to count the number of images in the folder I’d  
would make make the default of maximum number images a hig number (999 for instance).

Now u just have to check the size(getBytesTotal) of the container MC or level u are loading the jpg into(give it a frame or so it has ‘time’ to start loading it) if it’s 0 do wathever happens at the end of your slide show.

Cheers

SHO

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 17, 2002, 10:46am UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797/3 "2002-10-17T10:46:45Z")

</div>

I don’t know about that, Eki. Are you sure that if a picture is in the cache it won’t screw up everything?

Concerning the question, I’d do it with PHP.

pom :asian:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 17, 2002, 10:59am UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797/4 "2002-10-17T10:59:01Z")

</div>

Hi,

It won’t if the images names are numbered and accessed by an increasing variable made string added to the default name of the image (img1, img2, img3,…etc), will it?

Cheers

SHO

Ps.: alternatively use the “anti-cache” code found in Kirupa’s  
tuts

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 17, 2002, 11:11am UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797/5 "2002-10-17T11:11:01Z")

</div>

Of course, but since it’s an image viewer, we can suppose that the user wants to go back at some point. And forcing the download once more would be wasting… 🙂

It’s really not that hard to implement in PHP.

pom :asian:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 17, 2002, 11:13am UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797/6 "2002-10-17T11:13:46Z")

</div>

Hi,

I guess it would…I don’t have a clue about PHP:x

Cheers

SHO

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 17, 2002, 11:38am UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797/7 "2002-10-17T11:38:39Z")

</div>

After reading your posts, it has been helping a little.  
It’s starting to help me see things a little differently in ways to attack this issue.  
And Yes, since it is an image viewer, the user needs the ability to move forwards as well as backwards.

But what if the server your running this app on doesn’t support PHP.  
Currently the server I’m developing on, doesn’t support PHP.

Thanks again for all your advice!  
David

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 17, 2002, 9:51pm UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797/8 "2002-10-17T21:51:27Z")

</div>

Then you’re screwed I’m afraid. Unless you use a textfile that you have to fill.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 21, 2002, 8:00pm UTC](https://forum.kirupa.com/t/dynamic-loaded-jpegs-question/6797/9 "2002-10-21T20:00:51Z")

</div>

ilyaslamasse

Could you tell me how to do it with PHP?

The client still want to persure this so I’m gonna try to make it happen.

I’d appreciate any help!

Thanks  
David
