03-14-2014 01:48 AM
Hi,
I am reading images that are stored in a folder into an image array. I have a slight problem when a non image file (using .png) is present.
What I have tried is to use a case structure to check if the file extension is a png (if it is a png then add to the array), if it is not a png file, then the false case is executed and a blank is inserted into the image array, since I have selected to "Use default if unwired". What I ultimately would like is for it to skip all non image files and have a image array with no blanks.
I honestly do not know what to do.
Could anyone please offer advice? Let me know if you would like any other information.
Regards,
Richard
Solved! Go to Solution.
03-14-2014 06:34 AM
Use a Pattern filer when you get your files from the folder, then you don't need to sort the files out after - Simple
James
03-14-2014 06:38 AM
Hi Richard,
while James noted the correct approach to only list PNG files in the first place you should consider for the next time:
Only do your "add to array" operation in the TRUE case. Then you don't need to output some default values from your case structure!
03-14-2014 07:13 AM
Thank you James!
I will be honest, I saw that VI but I was unsure about what it did. I was using the List Folder VI and then comparing each file in the folder.
Still a rookie and had to self teach myself LabVIEW, there are a few things that I overlook.
Richard