image and audio file mapper
panji - September 21, 2008 - 15:55
| Project: | Feed Element Mapper |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Description
Video mapper for Drupal 6 is work fine with a patch,.. But how about image and audio file mapper?

#1
Image field patch to be ported to 6: http://drupal.org/node/224235
Which image and audio fields are you asking for?
#2
I would love to see a mapper to take an image from an RSS feed, copy the image to the local fileserver, and insert it into the CCK imagefield.module field.
The D5 patch works in part with D6 - it downloads the image(s) to a temp directory, but the file data does not get inserted into the CCK field.
Presumably there is a missing call or something, but I am getting lost in the imagefield/filefield/cck complexities!
#3
Attached is a modified/hacked version of the D5 . I had to add some code to write the image to the drupal temporary directory, call field_file_save_file() to save the file in the widget specified directory and call field_file_save() to update the image-node association in the database.
Seems to work for my needs if others would like to test.
Peter
#4
Except for the Audio part it's a duplicate to #224235: Mapper for CCK Image Field
Changed to code needs review
#5
the patch in #3 appears to work.
however I get this error when a feed is parsed and made into nodes.
warning: imagecolorsforindex() [function.imagecolorsforindex]: Color index 255 out of range in /var/www/vhosts/.../httpdocs/includes/image.gd.inc on line 108.#6
http://drupal.org/node/224235#comment-1373150 is a slightly updated version of the patch in #3. It seems to work with all the latest modules, i.e., Feed Element Mapper 6.x-1.0-beta4, FileField 6.x-3.0-beta1, ImageField 6.x-3.0-beta1.
#7
Setting this to duplicate now, for imagefield/fielfield refer to #319538: Mapper for FileField / ImageField . Audio field: #336985: Mapper for Embedded audio field (emaudio) field