I use LibJPEG to read JPEG compressed images. Is there a way to get the current compression ratio of the unchanged image?
Do you mean the encoding quality, usually a number 0-100?
That isn't stored - it's used as a guide for the image encode as to how accurate the waves should be, and it's then discarded. There's no field for it in any of the JFIF header structures. As far as I can see there's no formal definition of what this number means across encoders and so you can't precisely determine the effects of any given number anyway.