title: C++ Read Information from Image
body: <p>I have to read some information from an image. When I drag the .tif image into Visual C++ 2006, it shows up like this:
  <img src="https://i.stack.imgur.com/jdctm.jpg" alt="enter image description here">
   I am trying to read in the min and max values that are specified on the right hand side of time image (highlighted in yellow). How can I do this? When reading from files, I usually do something like this:</p>
  
  <pre><code>ifstream fileStream(file_name); 
  string contents;
  while(fileStream &gt;&gt; contents) //do something
  fileStream.close();
  </code></pre>
  
  <p>However, when I try this approach with the given image and try couting contents as soon as information is read in, all that is printed out is:</p>
  
  <pre><code>contains = MM 
  contains =
  contains =
  </code></pre>
  
  <p>Clearly, it's not working. It only reads in information once, and stops reading after 3 iterations.</p>
  
  <p>So, how can I go about getting the max and min values from the image?</p>
  
  <p>Thanks!</p>