Submitted by admin on Fri, 09/06/2019 - 15:42

Feeds Image Grabber (FIG) was released on 3rd March, and currently supports the following features:

  1. Automatically downloads and attaches image to the node created by Feeds module.
  2. Configurable XPath of the desired image location on the webpage of the feed item on per feed basis (using element’s id or CSS class).
  3. Support for FileField Paths module.
  4. Configurable maximum image size.
  5. Configurable minimum and maximum image resolutions.

In this post, I will briefly demonstrate how to configure the settings for FIG to efficiently grab images for feed items.

Image Field Settings:

Feeds module will create nodes from feed-items of content type as chosen in the FeedsNodeProcessor settings. FIG will store the image grabbed in an image field attached to the node of this content type. Therefore, you must add an image field to this content type. For example, if the content type of feed-items is story, you need to go to admin > content types > story > manage fields and add a field of type File and widget Image. (http://drupal.org/node/609628)

Configure the settings of the image field, such as extensions, minimum and maximum resolution, maximum size, etc. While grabbing the image, FIG will automatically take into consideration the settings of the image field to which the downloaded image will be mapped.

Mapping Settings:

Now, you must go to the mapping settings for the Node Processor of the Feed Importer and map Item URL (Link) to one of the available imagefields which are appended by “(FIG)“.

Image removed.

Mapping for Node Processor

Feeds Image Grabber Settings:

After enabling FIG and configuring the above settings, you will see the following additional form whenever you create or edit a feed.

Image removed.

FIG config form

Here is a brief explanation of the available fields:

  1. Enable Feeds Image Grabber: As the description says, check this box if you want FIG to download images of the feed items created by this feed.
  2. Search for an image between the tag identified by: It has been explained before.
  3. Feeling Lucky: FIG will select the first image between the tag if the “yes” is selected, else will search for all the images to find the largest image between the tag.
  4. Execution time: FIG will take the selected percentage of maximum PHP execution time to grab image for each feed item. If images are not grabbed for some feed, try increasing this percentage to decrease errors due to network timeouts.

That is all. Once you click on import, you will get the feed item nodes along with the images. If images are not grabbed, here is a list of possible reasons,

  1. Timeout, try increasing the Execution time.
  2. Malformed HTML source.
  3. Validation failures (due to maximum size, minimum resolution, etc).

I am working on better error logging and reporting, so that you can know the reasons for sure.

Solutions Img