I'm adding images to products using the addImageToMediaGallery()
function like so:
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$product = Mage::getModel('catalog/product')->load(1234);
try {
$product->addImageToMediaGallery($filePath, ['small_image', 'thumbnail', 'image'], false, false);
$product->save();
} catch(Exception $e) {
echo $e->getMessage();
}
The images are uploaded to the gallery as intended but the media attributes (small_image, thumbnail, image) seem to be ignored and are not selected on the newly uploaded image.
I'm running Magento CE 1.9.2.2