PhotoDemon-nightly: Adjustments > Brightness and Contrast: fix potential overflow error
Latest
·
210 commits
to main
since this release
Relates to #452 . Thank you to @opsimathic for catching and reporting! Brightness and contrast are possibly the oldest adjustments in PhotoDemon (20+ years old at this point), making this a very old bug! When calculating average luminance for sampled contrast, I had mistakenly typed integer divide instead of floating-point divide and this can produce an overflow for images whose net brightness exceeds MAX_INT (~4.2e9). Problem now solved; updated nightly incoming shortly...