Saqib Khan was charged with contempt of court after being caught by staff while taking a picture on Monday June 27.
The law forbids any photographs or video recording inside a court building, and there are numerous signs posted around the Oxford Row building warning people they can be prosecuted.
Two teenagers in hospital after crashed motorbike sets on fire on Leeds street
Leeds Olympian Nicola Adams and girlfriend Ella Baig reveal baby boy's name as they talk about parenthood
Caught on camera Leeds: West Yorkshire Police need to speak to these people urgently
Met Office storm warning for Leeds - when the stormy weather is due to hit and how long it will last
17 pictures you'll only understand if you're from Leeds
Khan, 22, was brought before Recorder Marco Giuliani on Monday morning.
Recorder Giuliani said: "There are notices outside that tell you not to take images.
"The concern is what you were going to do with that photo, that is the serious nature of the matter.
"The worry is if it got posted on social media."
Khan, representing himself, said: "I did not understand and realise because I had not been in a court before. I did not see the signs.
"I was just going to save it on my phone, I do apologise."
Also in crime: Man jailed after booze and cocaine-fuelled car chase
Recorder Giuliani said he would not take any further action on this occasion, adding: "It's clear that you are very sorry and in light of your apology will not take it any further.
"I'm satisfied there was no malice.
"Do not make the same mistake again, security is taken very seriously and people who have breached this before have been sent to prison."
A charge of contempt of court can result in a maximum two-year prison sentence and a large fine.