Is it possible to tell the time of day by shadows on the photo I have a photo where objects and their shadows (e.g. trees, people) are visible, the Sun is not visible directly, but it is clearly neither dusk nor dawn.

Let's assume that coordinates of this place are known more or less precisely so that I can find it on google maps.

I also know the date when this photo was taken but don't know the time of day. Is it possible to estimate it from the photo?

I have a debate with a friend of mine about this.
My friend states that a reasonable enough estimate is to calculate the Sun's elevation above the horizon by

$$
\text{elevation} = \arctan \frac{\text{object's height}}{\text{shadow's length}}
$$

and then use one the myriad websites on the internets to look up the time for that date and location.

I doubt it because


The length of a shadow on the photograph depends on the relative position of the Sun, the object and the camera.
Most importantly, the slope of the ground can't be estimated neither from the photo, nor from google maps. This picture is a good example.


Who's right? Am I missing something?

Also, it would be interesting to understand the role of uncertainties in this calculation. Assuming that the surface is reasonably smooth and the slope is close to zero, what uncertainties (location, object's height, shadow's length, the slope, camera position) would play the major role? Does it depend on the time of year?
In short: If you know length of shadow and object height (assuming vertical object casting shadow of an horizontal surface), you can tell time if you know date and you can tell date if you know time. If you know direction of shadow (e.g. relative to north) you can tell date and time without knowing any of them.

The most tricky part is to measure objects and shadows from a photograph - because you need their real length and perspective distorts object and shadow lengths -. To do this you need to make some assumptions about the geometry of the objects in the photograph. In fact, if you know the geometry of the settings, after some geometrical calculation you can find the Sun position and therefore date and time.

For example, with an image like this one and a detailed map, you can find date, time, position of camera and even focal length of lens - with a lot of measurement and geometry calculation, of course.

However, if the only objects casting shadows in your image are trees and people, measuring their exact position and size would be impossible and date and time estimations will be quite rough, specially if the image doesn't show any other identifiable and measurable features - and even worse if you can't tell the north from features in the photo. In general, finding date and time from shadows works better with buildings, specially with sharp shaped buildings with known orientation.