Texas Gov. Rick Perry showed up Tuesday at the Travis County Courthouse in Austin for booking. Despite facing the possibility of more than a century in prison, he smiled like he was posing for an official campaign photo.

He then announced to the world on Twitter that he had gone out for ice cream afterward.

This was a more festive booking than those of corrupt governors including George Ryan, Rod Blagojevich, or John Rowland, who had used their offices for personal gain. Perry's case was different because governors aren't often indicted for using their legally uncontroversial veto power.

Many commentators have noted how flimsy the case against Perry is. But it's far more entertaining to focus on why Perry, a Republican, vetoed funding for the Public Integrity Unit of the Travis County District Attorney's Office, which is controlled by Democrats. If prosecutors attempt to impugn Perry's motives for the veto, he has videotape to explain them.

The story begins on April 12, 2013, when someone noticed a motorist swerving into oncoming traffic and driving for more than a mile along the shoulder. He called police, who found Travis County District Attorney Rosemary Lehmberg, head of the Public Integrity Unit, pulled over by the side of the road.

Lehmberg did not try to salvage her dignity. The local news got the tapes of her arrest and booking when she was sentenced to 45 days in jail. During her field sobriety test, Lehmberg could not follow the officer's flashlight with her eyes, walk a straight line without stumbling, or stand on one foot. “I don't think you smell alcohol,” she told her arresting officer. “And I haven't erratically drived (sic).”

Lehmberg protested at least 10 times for the camera that she was not drunk. At first, she denied drinking anything that evening. She refused a Breathalyzer test, but a blood sample taken under court order showed she was intoxicated at three times the legal driving limit — the equivalent of more than eight shots in an hour for a 150-pound woman, according to BloodAlcoholCalculator.org.

“You're going to ruin my career,” she said – a theme she would return to at least six times that evening when in front of the camera.

During booking, deputies had to place Lehmberg in a restraining chair and place a mask over her face that is usually reserved for inmates who spit on jailers. When this last fact was first revealed — before the videotapes came out — her attorney told reporters the mask was used to conceal her identity. There is no indication of this in the tape, on which deputies explain that she is being restrained because is belligerent and disorderly.

The head of the Public Integrity Unit tried repeatedly to pull rank. Referring to her handcuffs, she threatened deputies: “If you don't get these off me quick, y'all are gonna be in jail, not me.”

“I don't want an attorney,” she shouted at another point from her restraining chair. “I'm the district attorney. Get these cuffs off of me. Now!” She kicked and banged her cell door and repeatedly demanded to see the sheriff. When told the sheriff had already been notified of her arrest, Lehmberg was incredulous. “I just don't believe that, because he would be here.” She was also dismayed to learn that the sheriff had approved a warrant to take her blood.

Subsequently, Perry threatened to veto funding for the Public Integrity Unit unless Lehmberg stepped down and let someone with some integrity do the job. She refused, so he carried out his threat.

And so Lehmberg's office brought in a special prosecutor to get the indictment. But Perry has the tape – hence the confident smile in that mugshot.

DAVID FREDDOSO, a Washington Examiner columnist, is the former editorial page editor for the Examiner and the New York Times best-selling author of Spin Masters: How the Media Ignored the Real News and Helped Re-elect Barack Obama. He has written two other books, The Case Against Barack Obama (2008) and Gangster Government (2011).