Here’s your interesting piece of photo trivia ‘o the day: John Quincy Adams, the sixth President of the United States, was the first president to have his photograph taken (the earliest photo still in existence, at least). The daguerreotype was shot in 1843, a good number of years after Adams left office in 1829.
On the other hand, if we’re considering photographs taken in office, that distinction goes to James Polk, the 11th President. This photograph was captured in 1849:
The first inauguration captured on camera was James Buchanan’s (15th President) in 1857:
More recently, President Barack Obama was the first to have his official photograph shot with a digital camera (the Canon 5D Mark II).