The short answer is: you can't.
I have taken photos of 1000's of paintings and you simply will never get rid of the glare without influencing the fidelity of the reproduction of the painting. You can use "dodging and burning tools" (the old-fashioned terms), but the details are not there and it rarely results in something presentable. Most image editing programs have these tools.
If this is not possible, the next best thing to try is to take two photos where the glare is only visible in one half of each image (but opposite halves), carefully correct each image for shape (square them off) while perfectly aligning the details in them, and then add a mask to the one on top such that you only get the best part of each photo.
The best way to take a photo of a painting (without a pro studio and really good lights that are far away) is to use a polarized filter and polarized light sources, and then make color/saturation adjustments to correct for the polarizer's influence.
If this is for a book, get someone to take a proper shot of it. Anything less is a waste.