After a bit of trial and error, I've sorted out how to create readJPEG compatible JPEG images from the command line. Requires ImageMagick.
convert image.jpg -sampling-factor 1x1 -define jpeg:extent=5000b image_encoded.jpg
The key here is -sampling-factor 1x1 without it, the tool produces incompatible images (H2V2, I think). Also useful is -define jpeg:extent=5000b which adjusts the quality parameter as needed to cram the image into a limited file size.