Using ofLoadURLAsync to load as many files as quickly as possible

Hi All,

So I’m using Open Frameworks to download hundreds of images from a server. I use ofLoadAsyncURL() for creating an instagram visualizer and had pretty good success with it in version OF 0.7.3 , in version 0.7.4 I kept receiving crashes with ofLoadAsyncUrl , but now with 0.8 released I figured I’d give it a shot. But… it seems to only be using one thread or loading one image at a time. In 0.7.3 it at least seemed like it using more than one thread ( unless I’m totally off base here ) But the images I used before are smaller than what I was dealing with at the moment. Is it possible to open up more threads to do this with ofLoadAsyncUrl ? Or should I just create my own class that wraps ofLoadUrl( ) in a threadedFunction() call ? This seems like it might be the path of least resistance.

This is the class I’m working on and tweaking : https://github.com/HeliosInteractive/ofxHeliosLibs/blob/master/src/ofxLoadingManager.cpp

The goal is to load in any file from a server and save a local version and then notify the app that it’s ready. Any advice or guidance would be greatly appreciated. Thanks !

Any luck with this?

I haven’t used OpenFrameworks to access Instagram photos, but have created a directory monitoring class that allows me to monitor a folder, and load in any new images. This way I have a local version saved and can also use any image file I choose to load into the application.

I’m interested in bringing in the Instagram code into my application though.

instead of using ofLoadURLAsync, create instances of ofURLFileLoader and use them to load the images. Every instance will run in it’s own thread so you can control how many threads you want to use just by creating as many objects in a vector for example

1 Like