Most optical color printers (up until the latest laser versions) are still in operation and came with a set of legacy masks. the print size can be adjusted by a knob on the right feed roller to account for length of print, and the lens can be moved to give proper magnification. Even some laser printers can do this.

OTOH, automatic optical enlargers can handle this with no problem. I have masks for my enlarger for sizes from 35mm to 4x5 in several formats and can get more just by ordering them.