Skip to content

Commit

Permalink
prevent HEADERS ALREADY SENT error
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyingmana committed Oct 7, 2016
1 parent 5aeb0b6 commit 634ec5c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,12 @@ public function thumbnailAction()
$file = Mage::helper('cms/wysiwyg_images')->idDecode($file);
$thumb = $this->getStorage()->resizeOnTheFly($file);
if ($thumb !== false) {
ob_start();
$image = Varien_Image_Adapter::factory('GD2');
$image->open($thumb);
$image->display();
$this->getResponse()->setHeader('Content-type', $image->getMimeType(), true);
$this->getResponse()->setBody(ob_get_clean());
} else {
// todo: genearte some placeholder
}
Expand Down

0 comments on commit 634ec5c

Please sign in to comment.