You should have been more specific about your reason for changing calibre. It already provides for selecting any amount of compression for JPEG images. No need to modify any source code.
In the calibre GUI right click on the book, select "Edit book", then in the "Tools" drop down menu select "Compress images losslessly", then check the "Enable lossy compression of JPEG images", then set the compression quality to whatever you like.
Well, now that I have written all that, I see that is a lot to go through for every book. I also think the "losslessly" oscures that there is the possibility to enable lossy compression.
|