(CNN) The image of cold-blooded, scaly, reptilian dinosaurs imprinted in our imaginations by movies like "Jurassic Park" may be inaccurate.

Now, research from Yale University suggests the blood that coursed through their giant frames would have been warm, meaning they might not have been cold-blooded creatures after all. The findings come from an analysis of fossilized eggshells.

"Dinosaurs sit at an evolutionary point between birds, which are warm-blooded, and reptiles, which are cold-blooded," said Robin Dawson, who conducted the research while she was a doctoral student in geology and geophysics at Yale. "Our results suggest that all major groups of dinosaurs had warmer body temperatures than their environment."

The researchers tested eggshell fossils from a Troodon, a small, meat-eating therapod (the same family as the T-Rex); a duck-billed, plant-eating dinosaur called a Maiasaura; and a Megaloolithus, a sauropod known for its huge size.

'Ancient thermometer'

By looking at the order of oxygen and carbon atoms in the fossilized egg shells, the researchers were able to calculate the dinosaur mom's internal body temperature. It's a process called "clumped isotope paleothermometry."

"Eggs, because they are formed inside dinosaurs, act like ancient thermometers," said Pincelli Hull, an assistant professor at Yale University's Department of Geology and Geophysics, and a co-author of the study.

To help understand the temperature of the local environment when the eggs were laid, the researchers conducted the same kind of analysis on fossilized shells of cold-blooded invertebrates, which take on the temperature of their surroundings.

They found that the samples they tested suggested that the dinosaurs' body temperatures were warmer than their surroundings would have been. So unlike reptiles, which rely on heat from the environment, the research indicates that dinosaurs were capable of internally generating heat.

The different dinosaurs varied in how much their body temperatures were higher than their environment. The Troodon samples were as much as 10 C warmer, while the Maiasaura were 15 C warmer. The Megaloolithus samples showed the smallest range of 3 C to 6 C warmer.

"What we found indicates that the ability to metabolically raise their temperatures above the environment was an early, evolved trait for dinosaurs," Dawson, the lead author of the study that published last week in the journal Science Advances, said in a news release.

Whether dinosaurs were cold or warm-blooded has been a long-running debate among paleontologists. A study from 2014 suggested they were neither, occupying a middle ground.

"Understanding these giants of the terrestrial realm has been at the forefront of science for centuries, and it really matters if they are cold or warm-blooded. It changes how active we think they were and how they would have interacted with the environment," Hull said.

While once controversial, it's now widely accepted that many dinosaurs would have some type of feather-like structure.

However, why dinosaurs first evolved feathers is still a big topic of discussion.

Dawson said this research suggested that it would have helped them keep warm.

"It's possible that dense feathers were primarily selected for insulation, as body size decreased in theropod dinosaurs on the evolutionary pathway to modern birds," Dawson said. "Feathers could have then later been co-opted for sexual display or flying."