Originally there was some talk by the Allies of first demonstrating the A-bomb.
But then the argument was: What if it doesn't work or doesn't work well?
So then there was talk of Warning the Japanese.
Well again what if it doesn't work or doesn't work well?
So the final idea was drop it without warning. However the Allies did send a cable a couple of days before the first detonation demanding the unconditional surrender of Japan without any new reasons being given except the apparent fact that Japan would eventually lose the war.
Dropping the A-bomb a second time without warning also did two things:
1. It maximized shock value
2. It left the question open whether the US still had more A-bombs in their arsenal just waiting to be dropped
Well it certainly shocked Japan but that was not the reason they actually surrendered. They were still adamant to keep on fighting unless they could retain the Emperor as a true monarch. Turns out the primary reason for Japan's surrender was that Communist Russia attacked Japan in China and so doing declared war on Japan. So with that Japan was truly finished.
So to answer the question with my 2 cents: No it was not a war crime. Japan would have fought to the last man, women and child if Russia had not entered the war against Japan. The Allies had to minimize their casualties while still gaining victory. If Japan had continued the War as they were aiming to do, the US would have systemically nuclear carpet bombed them until the Japanese realized the truth of their situation.