Automation of image loading for products in online catalogs

    image

    Being engaged in the development of online catalogs (or online stores) faced with the problem of selecting images for the product. Not every customer can allow to take photographs of each product in their processes (especially when there are more than 7000 of them), and does it make sense to photograph products when their images are already on the Internet, and it is absolutely legal on manufacturers' websites. Manually downloading and uploading images is not an option. During the work we tried a lot of ways to "automate" this process:
    • Unloading goods from 1C and image synchronization
    • Uploading “bulk” pictures via FTP
    • Google Image Search


    Unloading goods from 1C and image synchronization


    Situation: The store sells second-hand and stock clothes. The problem is that there are no photos or finding them is very problematic. Clothing comes in trunks and the store does not even know what is in them (bought by weight).

    The girl-merchandiser is engaged in acceptance, in the database 1C enters data on the product. This thing is placed on a table with a white background, above which is mounted a conventional digital camera. Next, the girl presses a specially trained button in 1C, clicking on it launches an external application that takes pictures of the product and saves the picture in a folder, naming the file by article number.

    Profit: the photo is stored in 1C, it’s convenient for sellers to navigate in the product. For example, a buyer comes from the site and says that he wants the product of a certain article or name, everything gets hammered into the 1C search, and in addition to a dry description, an image is also given. Now the girl knows the product by sight and can easily find it in a sea of ​​other things. Second-hand ... But

    back to business. The folder on the local computer is synchronized with the server on which the site is hosted. Further on the server, the pictures are resized to the desired size and saved in the right places. A separate song about how to resize 7000 pictures on a shared hosting, believe it is real.

    As a result, we get a fairly high automation of the whole process, which requires minimal human involvement. Well, of course, all postings, purchases, online sales are synchronized with 1C, since they began to flirt with it.

    Uploading “bulk” pictures via FTP


    Everything is simpler here, the situation is this: the customer has branded images, uploading manually via the web interface is simply not realistic, there are a lot of them, these pictures, for each product there are more than 5-6 additional images. Do not be afraid, as a rule, manufacturers of goods provide their images, naming files already by article number.

    Pictures are simply uploaded to FTP, and the site knows where to look for them. Everything is simple and clear.

    Google Image Search


    Now the most interesting, as it seems to us. The situation is as follows: a store that sells offline with well-known brands (Grohe, Tarkett and other interior and decoration staff) decided to create an online catalog of its products to start with. As you know, images play a decisive role there. The store has several thousand items (about 15,000) and it is not yet possible to synchronize the site with the product base. A few specially trained monkeys will be allocated to enter the goods. And it is clear that a person will search for some of the images on the Internet, save them, upload, etc. A very long time.

    We found a simple and elegant way to upload images. Google provides its Google Search AJAX API , it’s a sin not to use it. It makes no sense to go into technical implementation - everything is simple there.

    The product description necessarily includes the brand and the article, the specifics of this product (construction staff) is such that there is such a thing as “Collection” - a set of products. And after adding this data, a request is sent to the Google API, and it returns a JSON array with information about the images found. Images are shown to the “drive-in” and he selects a suitable image for downloading and bringing it to the desired format. In 90% of cases, the pictures satisfy the needs.

    Everyone is happy ...

    Let's not discuss the topic of the legitimacy of using these images, let the choice remain on the conscience of the “drive”, as it selects the download source and can visually determine whether this image is branded. It should also be noted that the seller is the official representative of these brands in our city and he has the right to use images from manufacturers' websites.

    We will not give links to sites, we are afraid of the habraeffect, and PR of these resources is inappropriate here. Who cares - knock on the PM.

    UPD

    Due to the large number of questions in the PM, I post an example (our developments are based on ZendFramework, this code is just for example)

    If you do not need AJAX, then everything is as simple as that.
    http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=Fillipino%20long time
    There are additional image filtering options.

    PHP executes the request and the API returns an object in JSON format:

      $query = 'Филлипинский долгопят';
      $body = file_get_contents('http://ajax.googleapis.com/ajax/services/search/images?v=1.0 &q='.urlencode($query));
      $json = json_decode($body);
        foreach ($json->responseData->results as $result) {
           echo '';
          }

    * This source code was highlighted with Source Code Highlighter.

    The result array contains a lot of useful information. List of the most needed array keys:
    • imageId - unique identifier of the image
    • url - shielded url pictures
    • width, height - image sizes
    • tbWidth, tbHeight - preview sizes
    • tbUrl - link to the preview image
    • title - picture description


    Search news, blogs, etc. works the same, but returns other array keys.
    If you still need to search with AJAX, then there are already good articles on this topic

    Also popular now: