A motorist was snorting drugs on a Fife country road before crashing his car.
Liam Stark was unconscious and trapped in the vehicle following the smash, which happened near Knockhill.
Stark and his female passenger had been snorting ketamine just before the crash, which resulted in his car being written off.
Stark, 21, of Cook Square, Lochgelly, appeared in the dock at Dunfermline Sheriff Court.
He admitted that on September 19 last year on the B914 he drove when unfit to do so through drink or drugs.
Snorted ketamine and blacked out
Depute fiscal Azrah Yousaf said at around 10.30pm police received a report of a crash not far from Knockhill race track.
They were told there were two people trapped in the car and the fire service was also called to the scene.
Stark was unconscious and his female passenger was seen to have powder around her nostrils.
She said they had been snorting ketamine just before the collision.
Defence solicitor Calum Harris said: “They were caught red-handed and it was self-evident what was happening.
“They had been at Kelty and he was giving her a lift.
“They made the foolish and illegal decision to take this.
“He had previously had an addiction to this drug and when he took it this time he blacked out.
“The next thing he recalls was there being police officers around him.
“His car was written off.”
Sheriff Charles Lugton told Stark: “You could have killed somebody.”
The sheriff banned Stark from driving for a year and fined him £420.