support from buffer memory files

This is a (near) duplicate pull request of the 2.3 variant for buffer memory files (images).