Best way to load multiple image file


#1

I have a situation where I have to load multiple image files (hundreds) and save it as boolean.

For now, I will have to repeat one by one with a sequence for each files…
1)Load Image- “1.png” ,save as image variable “image1”
2)ImageExist- load image “image1” ,save as boolean variable “booimage1”
3)Assign “image1” image variable to Argument “ARimage1”
4)Assign “booimage1” boolean variable to Argument “ARbooimage1”

I do this because I’ll need it to work with the main workflow, this workflow will fetch and act as a database file.

For this scale, what is the best way you recommend to work with?


#2

It’s not very clear what you’re trying to do…
Did you insert these activities inside a For Each?
Or do you call that sequence whenever a new image is available to be processed?


#3

I will use this workflow as a database, and parse the image & boolean as argument to the main workflow. so, whenever a image “condition” appear on the main workflow, the bot will be able to recognize and take immediate proceeding. So, this workflow will only load all the condition images save it as image variable and boolean also assign it to arguments to be parse to the other workflow.

My question is, how is this done easily without manually fill in each file, 1.png, 2.png,3.png… and so on…
also, I have to make a new image variable, a new boolean variable, and their arguments for each image…

is there a syntax to automate this process? How does a for each do all this?


#4

If you have a folder with all the images, you can get all the file paths using Directory.GetFiles(in_InputFolder) and then use a For Each activity to iterate through them without explicitly creating one variable for each.

However, that’s probably not a good idea, because you’ll have poor performance for a large number of images. Instead of reinventing the wheel, I’d recommend to look for a way to store these images in a proper database optimized to do image search.
Then, from the workflow, you just send a query to this database and get the result saying whether it was found in there.