Add an image attribute in Magento product admin

Login to your Backend and go to Catalog->Attribute->Manage Attribute

Here create a new attribute and choose its input type "Media Image".

After create attribute assign to its in attribute set.

Once you assigned this then you can view this media attribute on Add product window in images tab.

How to call this attribute in product view page? using this code:

$hdr_img = $_product->getHeaderImg();`

if ($hdr_img) {
    $ban_img = $this->helper('catalog/image')->init($_product, 'header_img')->resize(1600, 312);

    echo '<img src="'.$ban_img.'"/>';
}

Here My attribute name is "header_img".


Add new attribute from admin-end Catalog -> Attribute -> Manage Attribute -> Add New Attribute
Select media image under the dropdown Catalog Input Type for Store Owner
Now assign this newly created attribute to the attribute set and run indexation and clear cache.


I know it's already answered but I'm still writing as I think someone would have been here again. Yes you can upload and get any sized image instead of predefined thumbnail image.

Here are the steps below..

  1. Create a new attribute and choose its input type "Media Image".
  2. After creating attribute assign it in attribute set.
  3. Once you assigned this you can view this media attribute on Add/Edit product page in images tab like in the screenshot.For me it's Manufacturer Logo
  4. Don't forget to exclude it otherwise it'll be on the product gallery on the frontend.
  5. Use the code below to show that image where you like to.

    $manufacturer_logo = $this->helper('catalog/image')->init($_product, 'manufacturer_logo')->resize(600, 312);
    if($manufacturer_logo)
    echo '<img src="'.$manufacturer_logo.'"/>';
    

NOTE: for me attribute name is manufacturer_logo. Use ->resize(600, 312) function to resize desired size image.