While preparing screenshots for another bug the player gets hurt 1/2 heart when taking screenshots.
Tracks are underground, below the tracks is just one block, over the track one block air.
Related issues
Attachments
Comments

I wasn't able to reproduce this; taking screenshots in an environment like you depicted in your pictures didn't result in any damage.
Was it on a server?
Can not reproduce by just sitting in a minecart and taking pictures. I guess you are getting random suffocation damage because of the low ceiling or the near wall. But I guess one block of air should be enough. Hmm.

Yes, multiplayer. Just me alone on the server. I don't really know what's so special at that specific location. Taking screens in a 1x2 tunnel on the same track some blocks further doeesn't yield damage.
All I can say is you are glitching through a block. But I don't know why..MAYBE you took those screenshot when you were about to glitch in to it..MAYBE.
FWIW, I take damage in multiplayer in moving mine carts as well, though it doesn't require taking screenshots, so I'm not sure if it is the same bug. It happens when using a higher-latency network, such as 3G/4G tethering, so that might help to reproduce. The rest of the game works quite well with 250ms latency, which is wonderful, but it does really break down a bit in mine carts. I can file separately if unrelated.

The lag is low because 1G LAN, the minecart was standing still or slowly moving. Every press of F2 caused damage.

Rebuild the underground structure and the effect was reproducible