assertimage_size<unsparsed_image_size,f"AVB footer's original image size {image_size} is larger than or equal to image size on disk {unsparsed_image_size}, this can't happen because a verified image = original image + hash tree data + FEC data + avbfooter."
assertimage_size>0
image_blocks=int(image_size)//4096-1
# It's OK for image_blocks to be 0, because care map ranges are inclusive.