Looking at that photo, said to have been taken before the police fired, they held back from firing and fired well after it was justified. As soon as that barrel is pointed at you it takes a fraction of a second to fire a shot. I'm surprised they waited until he was pointing at the officer, usually they won't wait until a gun is pointed at them because they know from past experience that could be too late to defend yourself.
Search "the 21 foot rule", look at the videos on youtube of how fast a person with a knife can attack at the distance of 21 feet and how low the chances are to even draw and get off just one shot, if they are lucky enough to fire one shot. Even if they get a shot off most likely it's not going to stop them in their tracks because they have momentum, so even if hit they will likely still make contact. It takes the average person just 1.5 seconds to close a 21 foot gap from standing still, an officer has to recognize the treat and react in less time. Often an officer has to make a decision in just one or two seconds, that's why the yell repeated commands, it's a warning to obey or face the consequences. Just obey what an officer tells you, that's it, not complicated. If you look at all of these shooting that make the news, what they all have in common, the "victim" didn't obey commands, every damn one.
Instead of obeying the commands from the officers this guy pulled a vamo or what ever it was from his pocket, put both hands on it and took a shooting stance. It's sad, but I'm sorry, his death is not the fault of anyone but himself.