2 Replace file_exist with ECG compliant method
source | link

For showing image into edit form, you want to render the image.

Replace your addField to below

$fieldset->addField('image', 'image', array(
'label'    'label'    => Mage::helper('catalog')->__('Image'),
'required'    'required' => false, // Make true if required field
    'name'     => 'image',
    'renderer' =>'employee=> 'employee/adminhtml_employee_renderer_image',         
));

Here as you can see we have specified an renderer block type as ’employee/adminhtml_employee_renderer_image’employee/adminhtml_employee_renderer_image. Now we need to create this Block. The code inside this block is as follows:

<?php
class Namespace_Employee_Block_Adminhtml_Employee_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract{
{
    public function render(Varien_Object $row)
    {
        $imageName = $row->getAfterImage(); 
        $imagePath = Mage::getBaseUrl("media").$imageName;                 

        $io = new Varien_Io_File();
        if (file_exists$io->fileExists($imagePath) && !empty($imageName)) {           
        return    return "<img width='50px' height='50px' src='".$imagePath."' />"; 
        } else {
         return   return ""; 
    }    }
    }
}

For showing image into edit form, you want to render the image.

Replace your addField to below

$fieldset->addField('image', 'image', array(
'label'     => Mage::helper('catalog')->__('Image'),
'required'  => false, // Make true if required field
'name'     => 'image',
'renderer' =>'employee/adminhtml_employee_renderer_image',         
));

Here as you can see we have specified an renderer block type as ’employee/adminhtml_employee_renderer_image’. Now we need to create this Block. The code inside this block is as follows:

<?php
class Namespace_Employee_Block_Adminhtml_Employee_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract{

public function render(Varien_Object $row)
{
    $imageName = $row->getAfterImage(); 
    $imagePath = Mage::getBaseUrl("media").$imageName;                 

    if (file_exists($imagePath) && !empty($imageName)) {           
        return  "<img width='50px' height='50px' src='".$imagePath."' />"; 
    }else{
         return  ""; 
    }  
}
}

For showing image into edit form, you want to render the image.

Replace your addField to below

$fieldset->addField('image', 'image', array(
    'label'    => Mage::helper('catalog')->__('Image'),
    'required' => false, // Make true if required field
    'name'     => 'image',
    'renderer' => 'employee/adminhtml_employee_renderer_image',         
));

Here as you can see we have specified an renderer block type as employee/adminhtml_employee_renderer_image. Now we need to create this Block. The code inside this block is as follows:

<?php
class Namespace_Employee_Block_Adminhtml_Employee_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
    public function render(Varien_Object $row)
    {
        $imageName = $row->getAfterImage(); 
        $imagePath = Mage::getBaseUrl("media").$imageName;                 

        $io = new Varien_Io_File();
        if ($io->fileExists($imagePath) && !empty($imageName)) {           
            return "<img width='50px' height='50px' src='".$imagePath."' />"; 
        } else {
            return ""; 
        }
    }
}
1
source | link

For showing image into edit form, you want to render the image.

Replace your addField to below

$fieldset->addField('image', 'image', array(
'label'     => Mage::helper('catalog')->__('Image'),
'required'  => false, // Make true if required field
'name'     => 'image',
'renderer' =>'employee/adminhtml_employee_renderer_image',         
));

Here as you can see we have specified an renderer block type as ’employee/adminhtml_employee_renderer_image’. Now we need to create this Block. The code inside this block is as follows:

<?php
class Namespace_Employee_Block_Adminhtml_Employee_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract{

public function render(Varien_Object $row)
{
    $imageName = $row->getAfterImage(); 
    $imagePath = Mage::getBaseUrl("media").$imageName;                 

    if (file_exists($imagePath) && !empty($imageName)) {           
        return  "<img width='50px' height='50px' src='".$imagePath."' />"; 
    }else{
         return  ""; 
    }  
}
}