[drupal-devel] Make image module an extension of upload module

Robert Douglass rob at robshouse.net
Mon Apr 18 14:29:32 UTC 2005


I love the new image modue. Is there any reason why it is adventageous 
to have images be nodes, and if so why don't we extend this to all of 
the files that we upload?

A proposal: from my casual and not exhaustive reading of the image 
module code, it seems like the coupling to the node table is only very 
superficial. It would therefore be possible to extend the image module 
to respond to any images which come in as attachments via the upload 
module and process them in the same way that the image files attached to 
image nodes are processed. The two major changes which would need to be 
done to enable this are:

1) accept the file_api patch[1] which is in the queue and has a 
relatively strong amount of support

2) rewrite the image module queries which select on node.type='image' to 
  files.filemime in (image/gif, image/png, image/jpeg).

The advantages of doing this would be a more logical workflow, the end 
of images coming into the system but not being recognized as such, one 
fewer content types that users need to deal with and better support of 
mass uploading.

The last point merits a little more attention as that is actually my 
impetus for bringing this up. I'm working on ways to upload multiple 
files from one screen, either via multiple upload forms or by uploading 
a .zip file which gets unpacked. While this should be relatively 
straightforward for attachments, for images it is hairier as the concept 
of an image node only accomodates 1 image.

Welcoming thoughts and comments! Any advantages or disadvantages that I 
haven't thought of? Any technical problems that I haven't forseen?

cheers,

Robert

[1] http://drupal.org/node/18934



More information about the drupal-devel mailing list