embdgen.core.utils.image
Utility functions for working with images
- class embdgen.core.utils.image.BuildLocation[source]
Bases:
object
Temporary location of the builds
- property path
- embdgen.core.utils.image.create_empty_image(filename: Path, size: int) None [source]
Create an empty sparse (if possible) file
- embdgen.core.utils.image.copy_sparse(out_file: BufferedIOBase, in_file: BufferedIOBase, size: int | None = None) None [source]
Copy sparse from in_file to out_file up to size bytes. This does not necessarily create the minimum sparse file. In the current implementation it only makes 4096 byte blocks of zeros sparse. If a block is shorter, it is actually written to the out_file. This is a time vs. space optimization. Checking if a fixed size block is empty can be implemented very fast in python, but checking if an arbitrarily long block is empty is not very efficient.