cyberang3l/timelapse-deflicker

Crashes on completely black pictures

Opened this issue · 1 comments

I have some completely black pictures and it seems the script is not able to handle those as there's going to be division by zero error.

Here's a quick fix (a bit better than in my previous suggestion which didn't work in all cases)

This is to replace the 274 line:

my $lumi = 0.0000001 ;
if ( $luminance{$i}{original} > 0 && $luminance{$i}{value} > 0) {
$lumi = $luminance{$i}{original} / $luminance{$i}{value};
}
my $brightness = ( 1 / $lumi ) * 100;

Thank you for reporting this bug. I'll try to take a look soon!