Reading jpg files from a folder....

dvwood's icon

I need to read a bunch of jpegs into a patch. Other than using the jit.qt.window, does anyone know what object to use? I cant seem to find it in the Max tutorials or help options.
Any suggestions to how i can implement this? I just want to read jpeg files, that are initially triggered by an FFT. Every time a sound is triggered by the built-in mic a jpeg should change to the next jpeg.

Help is much appreciated!

Dg's icon

[jit.matrixset] is the common way, since it loads the matrix in ram, you can acess quickly.

Jean-Francois Charles's icon

Another option is to make your jpegs into a movie (for instance using Quicktime Pro). Then, you just load the movie into [jit.qt.movie].
Another option is to read each jpeg only when you need it, for instance using a umenu & autopopulate, and triggering the next jpeg by telling umenu the new number.
But Kyred's option is surely the one to go first. You could use a umenu-based system to read the jpegs, dimension the jit.matrixset, and fill the set with the different images.
Send a patch of what you have (the jpeg reading system).
Jean-François Charles.

dvwood's icon

Thank you for all of your suggestions, i really appreciate it.
I have been toying around with it for quite some time now, and i simply can not come to a fruitful solution. I can easily read the jpegs using the jit.qt.movie into a jit.matrixset, but then i have to read every time i want to view a photo. I dont know what more i can do, or how i can make the umenu to work, as i have tried to connect it to several of the objects, but without any luck.
I simply want to loop through the photos in the umenu without having to read (use the read message) for each jpeg. Meaning opening every jpeg individually... also i am not quite sure of how the autopopulate variable works.

Check out the patch i have uploaded - Help is much appreciated!

FP's icon
Max Patch
Copy patch and select New From Clipboard in Max.

you can try this :

dvwood's icon

Im not sure how to implement that - SORRY!
I tried copy/pasting it into a patch, but it does not allowed me. Any suggestions?

FP's icon

i don't really uunderstad your problem.
just copy and do "new from clipboard" (cmd-alt-N).

dvwood's icon

That was weird, it worked fine when i did copy from clipboard. Anyways thank you very much, let me have a look at it.

dvwood's icon

Thank you very much for the help! I managed to redo the patch a little so it works as looping pictures and viewing them into a window. There is one problem though... my intention was to make a jpeg/photo viewer that is supposed work with an FFT / adc... meaning the input audio signal has to change a photo... at a certain peak, the next photo from the umenu has to be displayed.
I got really stuck in constructing this, as i have no idea to what i should connect the ezadc object.
Help is extremely appreciated!!
Check out the attached patch.

Jean-Francois Charles's icon

Study Jitter Tutorial 28. You could implement the "peak volume" detection it in your patch.
Then, if you want / need FFT, you should first make a separate patch dealing just with you FFT analysis / spectral peak detection.
Connecting this to your photo engine will be easy. You will need to study the MSP fft tutorials. I would use [pfft~], not only [fft~], might be easier to use, especially if you are beginning with FFT.
J-F.

to_the_sun's icon

I know this thread is old, but i would just like to say that FP's patch provided the solution i was looking for. I'm still having one problem though. Large pictures (like photo size) get scrambled when i try to display them with jit.pwindow. I've created another post for this as it's likely an entirely different issue: https://cycling74.com/forums/images-with-variable-dimensions-scrambled-jit-pwindows/

Gabriel Zalles's icon

@FP thank you so much for the solution. I used it in this project

https://youtu.be/8GkU9zU_NVM