OK, then just use a TIEBitmap and use Read() to input the stream, then Write() to output it.
https://www.imageen.com/help/TIEBitmap.Write.html
Something like:
bmp := TIEBitmap.create;
bmp.ParamsEnabled := True;
bmp.Read( ms );
// Set your JPEG quality, etc.
bmp.Params...
bmp.write( ms, ioJPEG );
bmp.free;
Nigel
Xequte Software
www.imageen.com