Add .hdr file writing support