Use List.map() to transform a list of elements into another list:
val fruitPics = List("banana.jpg", "orange.jpg", "strawberry.jpg", "apple.jpg")
val fileSizes = fruitPics.map(fruit => new java.io.File(parentDir, fruit).length)
// fileSizes: List(12321423, 643423, 234233, 2342343)