Function
create_padded_image
(input_file, output_file, start,
pad_start, copy_size)
Source from the content-addressed store, hash-verified
| 29 | |
| 30 | |
| 31 | def create_padded_image(input_file, output_file, start, |
| 32 | pad_start, copy_size): |
| 33 | pad_size = start - pad_start |
| 34 | with open(input_file, 'rb') as file_handle: |
| 35 | data = file_handle.read() |
| 36 | output_data = data[0:copy_size] + bytes([0xff] * (pad_size - copy_size)) + data |
| 37 | with open(output_file, 'wb') as file_handle: |
| 38 | data = file_handle.write(output_data) |
| 39 | |
| 40 | |
| 41 | def main(): |
Tested by
no test coverage detected