JPEG doceder from scratch.