In the past few years, semi-fragile watermarking has become increasingly important as it can be used to verify the content of images and to localise the tampered areas, while tolerating some non-malicious manipulations. In the literature, the majority of semi-fragile algorithms have applied a predetermined threshold to tolerate errors caused by JPEGcompression. However, this predetermined threshold is typically fixed and cannot be easily adapted to different amounts of errors caused by unknown JPEGcompression at different quality factors (QFs) applied to the watermarked images. In this paper, we analyse the relationship between QF and threshold, and propose the use of generalised Benford's Law as an image forensics technique for semi-fragile watermarking, to accurately detect the unknown QF of the images. The results obtained show an overall average QF correct detection rate of approximately 99% when 5% of the pixels are subjected to image content tampering, as well as compression using different QFs (ranging from 95 to 65). Consequently, our proposed image forensics method can adaptively adjust the threshold for images based on the estimated QF, therefore, improving the accuracy rates in authenticating and localising the tampered regions for semi-fragile watermarking.