Comment 1 for bug 1258418

Hello,

Which revision of the Magento connector do you use?

Normally, the image with the 'base' type should be used first.

It should take the 'base' image first, then sort them by position, as seen in the test case below (images are .pop()'ed from the list, so the order goes from right to left). When one of the image can't be read (404 for instance), the next image will be imported.

    def test_image_priority(self):
        """ Check if the images are sorted in the correct priority """
        env = mock.Mock()
        importer = CatalogImageImporter(env)
        file1 = {'file': 'file1', 'types': ['base'], 'position': '10'}
        file2 = {'file': 'file2', 'types': ['thumbnail'], 'position': '3'}
        file3 = {'file': 'file3', 'types': ['thumbnail'], 'position': '4'}
        file4 = {'file': 'file4', 'types': [], 'position': '10'}
        images = [file2, file1, file4, file3]
        self.assertEquals(importer._sort_images(images),
                          [file4, file3, file2, file1])