Should you just take the photo as is?
Ultimately this is up to your own discretion. While it is lovely that you are thinking and trying to act based off of what they will most appreciate, the problem is that there is no sure way to know from just looking. Some people may get terribly embarrassed from having such a thing pointed out and some will be super thankful, (personally I would say that more often than not people will fall in the thankful group) all you can do is make a judgement call at the time it happens. Fortunately neither way is particularly rude and just the fact that you are considering/worrying about whether or not they would like for you to point it out shows that you are approaching this from the right angle.
A typical example that would be the main reason for me whether or not I decided to tell them is if you are able to tell them the information privately, or if they are in a large group that would overhear you. If they are in a large group, singling one person out and telling them to adjust their shirt draws a large amount of attention to the person and their shirt, so I would say that there is a larger chance they will feel embarrassed and I would be more likely to choose to not tell them and just take the photo; or, if I did decide to let them know, I would keep in mind the group aspect when coming up with what to say. One way to do this could be:
Person A, B and C could you adjust your shirts please?
This spreads the attention across everyone and also normalizes the interaction of being told to adjust your shirt (less embarrassing to do something socially considered as normal)
If you are taking a solo photo, or have some other means of communicating to the person privately that their shirt needs fixing, it is more clear that you are doing this for the benefit of them taking a good photo and they will probably recognize this and be thankful for the advice, which is why I would be more likely to tell them instead of just taking the photo. When telling them I would be clear and to the point to make sure they understand exactly what I am telling them while minimizing the duration of the awkward conversation. One thing I might say is:
Your shirt is folded in
It may seem a bit blunt but it works because in cases like these, directly highlighting the issue means there is little chance of anything being misunderstood and the up front way you let them know will be appreciated i.e. they will probably respond with "thank you".