Assumes blocks are 4k large by default. rejpeg will scan the image file for jpeg headers (assumed to be aligned to blocks) and then try to decode blocks until one fails to decode, back up and move on ...