A magistrate has praised the actions of a man who stole a wallet and two mobile phones, then turned himself in to police when he found images of what he thought was child pornography on one of the phones, a court has heard.

The man appeared in Ballarat Magistrates Court yesterday, where a suppression order was issued preventing his name from being published.

Upon learning the man's actions had led to child pornography charges being laid against a 46-year-old man, magistrate Michelle Hodgson said he needed to be congratulated.

"You did the right thing," she said. "That kind of offending is very serious. You are to be commended for your conduct even though it placed you at jeopardy of losing your own liberty."

The police prosecutor, Senior Constable Steve Kent, said the man had been in the supermarket car park on Little Bridge Street last October when he noticed a car window not fully wound up.