Described is the adding of padding to a content file (e.g., image and/or
audiovisual file) for anticipated subsequent use such that the content
file need not be re-encoded to add metadata and other data to it. For
example, padding may be added to an image file directly after an image
file directory, whereby the directory can grow as needed into the padded
space. Metadata can likewise be added to the padding, e.g., from the
opposite direction that the directory extends into the padding. The
padding may be added on the first re-encoding of the file, reducing or
eliminating the need for subsequent re-encoding. The padding also may be
used to track dead space in the file, with adjacent regions of dead space
coalesced into a single region of dead space.