How to autofit (not stretch) a texture in a cube

Just wondering how do I put a rectangle texture in a cube in a way that it auto-fits and leaves empty areas with black color.

Open a drawprogramm, put your picture one a rectangel workspace, fill the rest with black color.