This is likely a strange scenario. I got a preproduction HTC One M7 from a friend who works at a wireless carrier... it was just an extra phone that he had since I had lost mine.
It is preproduction hardware... so the exterior looks nothing like the normal HTC Ones. But all the internal guts are the same... except for the camera! It does not have a rear-facing camera! So when I got the phone, if I opened the camera app, it would only open and use the front facing camera. Ok, no biggie, it was a free phone after all!
But then I started to get creative, and unlocked, rooted, and installed Cyanogenmod on the phone. Interestingly enough, there was no camera app on the phone. So I went and downloaded Google Camera. And now... when I open this camera app (or any of the dozen that I've tried), I get an error saying "Camera Error. Can't connect to the camera.", and then the app closes. I'm assuming that is because it is trying to open the app with starting up the rear camera. I tried finding an app that might only open the front camera, but couldn't find an app that worked.
Any ideas? Unfortunately, while I made a Nandroid of my previous stock ROM, I didn't realize that it would get blown away when I rooted and installed Cyanogenmod (i.e. the Nandroid was sitting in the /sdcard folder). So I can't even get back to a version of firmware where the camera works!