# Read a web image and filter out certain dimensions

**URL:** https://forum.kirupa.com/t/read-a-web-image-and-filter-out-certain-dimensions/263105
**Category:** Uncategorized
**Created:** [June 12, 2008, 4:34pm UTC](https://forum.kirupa.com/t/read-a-web-image-and-filter-out-certain-dimensions/263105 "2008-06-12T16:34:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kilotrixium](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@kilotrixium](https://forum.kirupa.com/u/kilotrixium)
#### Post date: [June 12, 2008, 4:34pm UTC](https://forum.kirupa.com/t/read-a-web-image-and-filter-out-certain-dimensions/263105/1 "2008-06-12T16:34:33Z")

</div>

Here is the pseudo-code to give you an idea what I want:

for (i == 0; i \<= 100; i++) {  
tempImg = get url (“[http://mysite.com/](http://mysite.com/)” + i + “.jpg”);

while (tempImg != fully loaded) {  
??? //sit around and wait?  
}

if (tempImg.width != 400 && tempImg.height != 320) {  
trace(“i” + “.jpg meet the requirements.”);  
}  
}

Basically, I want it to go through my site from 001.jpg to 100.jpg, and return all the pictures that are not 400 x 320, but I don’t know exactly how to code it.

The application doesn’t need to display the images on-screen or anything fancy. Simple tracing will do for now.

Also, if it is easier, it can be done by file size.

Thanks,  
Derek

(Actionscript 2.0)

---

<div class="post-metadata">

### Author: ![kilotrixium](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@kilotrixium](https://forum.kirupa.com/u/kilotrixium)
#### Post date: [June 12, 2008, 9:48pm UTC](https://forum.kirupa.com/t/read-a-web-image-and-filter-out-certain-dimensions/263105/2 "2008-06-12T21:48:33Z")

</div>

I’ve worked on it some more, and I’ve gotten down to the fact that I need help specifically on determining the (original) size of an image using te MediaDisplay component.

I used the MediaDisplay component (named “display”) to load the pictures, via:

loadMovie(“[http://mysite.com/](http://mysite.com/)” + i + “.jpg”, “display”);

I can’t find a way for it to give me the real size of the picture I’ve loaded.

When I try:

trace(display.\_width +" x " + display.\_height);

I get the output: 300 x 200 – for an image that is supposed to be 600x800.

And when I use: display.\_xscale = 60; display.\_yscale = 60; to make the pictures fit in the frame, the output changes to 180 x 120.

So, obviously, it’s not taking the original content size.

Maybe you guys have a fix to this? Or a better way to load external images into flash?

–Derek

---

<div class="post-metadata">

### Author: ![kilotrixium](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@kilotrixium](https://forum.kirupa.com/u/kilotrixium)
#### Post date: [June 12, 2008, 10:53pm UTC](https://forum.kirupa.com/t/read-a-web-image-and-filter-out-certain-dimensions/263105/3 "2008-06-12T22:53:41Z")

</div>

(Bumping because I added additional details in the form of an edit.)
