title: Magento DEBUG (7): Cannot send headers in Gd2.php
body: <p>2012-10-31T10:49:49+00:00 DEBUG (7): Cannot send headers; headers already sent in /home/happiniess/public_html/magento/includes/src/Varien_Image_Adapter_Gd2.php, line 133 </p>
  
  <pre><code>2012-10-31T10:49:49+00:00 DEBUG (7): HEADERS ALREADY SENT: &lt;pre&gt;[0] /home/happiniess/public_html/magento/includes/src/__default.php:17239 
  [1] /home/happiniess/public_html/magento/includes/src/__default.php:17123 
  [2] /home/happiniess/public_html/magento/includes/src/__default.php:17278 
  [3] /home/happiniess/public_html/magento/includes/src/__default.php:17490 
  [4] /home/happiniess/public_html/magento/includes/src/__default.php:20055 
  [5] /home/happiniess/public_html/magento/app/Mage.php:683 
  [6] /home/happiniess/public_html/magento/index.php:87 
  &lt;/pre&gt; 
  2012-10-31T10:49:49+00:00 DEBUG (7): Array 
  ( 
  [0] =&gt; Array 
  ( 
  [name] =&gt; Content-Type 
  [value] =&gt; text/html; charset=UTF-8 
  [replace] =&gt; 
  )
  
  )
  </code></pre>
  
  <p>When I check the code magento/lib/Varien/Image/Adapter/Gd2.php </p>
  
  <pre><code>public function display()
      {
          header(\"Content-type: \".$this-&gt;getMimeType());
          call_user_func($this-&gt;_getCallback(\'output\'), $this-&gt;_imageHandler); // 133 line
      }
  </code></pre>
  
  <p>Isn’t this a BUG?</p>
  
  <p>Who can give more tips how to debug it?</p>
  
  <p>I have added:
  /app/code/core/Mage/Core/Controller/Response/Http.php</p>
  
  <pre><code>Mage::log('HEADERS ALREADY SENT: '.mageDebugBacktrace(true, true, true)); 
  </code></pre>
  
  <p>/lib/Zend/Controller/Response/Abstract.php</p>
  
  <pre><code>Mage::Log('Cannot send headers; headers already sent in ' . $file . ', line ' . $line);
  </code></pre>
  
  <p>Then got the error info: /home/happiniess/public_html/magento/includes/src/Varien_Image_Adapter_Gd2.php, line 133 </p>
  
  <p>Now I don't know how to fix it!!!</p>
  
  <p>Help!!!</p>