I have created one Custom Attribute of media image type.
Attribute name = product_image_custom_1.
I need to display this custom image on Product Page at Footer.
I have used Below code in phtml file to print image.
<?php
$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_product = $block->getProduct();
$productImageAttr = $_product->getCustomAttribute( 'product_image_custom_1' );
$productImage = $this->helper('Magento\Catalog\Helper\Image')
->init($_product, 'product_image_custom_1')
->setImageFile($productImageAttr->getValue());
?>
<img src="<?php echo $productImage->getUrl() ?>" alt="<?php echo $block->escapeHtml($productImage->getLabel()) ?>" />
it prints image Fine, But Image label in Alt not display. it prints Product Name.
how to print alt text attribute in frontend?