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

James Walker walkah at walkah.net
Mon Apr 18 16:31:25 UTC 2005

On 18-Apr-05, at 10:29 AM, Robert Douglass wrote:

> 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?

yes - in fact the maintaining of "images as nodes" (but separating it 
from the image manipulation stuff) was very deliberate... as Boris has 
already mentioned - there is lots of stuff you get "for free" by having 
images as nodes - and it is really intended for "image as primary 
content"- type scenarios - i.e. photo / screenshot galleries, "photo 
blog", etc...

> 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

i'm amongst the supporters of this.

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

well - here's where stuff gets tricky - image.module currently does a 
bunch of stuff that may or may not make sense in a global context : 
i.e. generating a bunch of "derivative" sizes - i might not want this 
if i'm just attaching, say, a screenshot of a bug on a project issue... 
etc etc.

> 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.

If you haven't met already - I'd invite Scott Courtney to step forward 
at this point - please check out the good work he's been doing on 
"image_import" module ... which does this kind of stuff.

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

just that people don't always want want images treated the same in all 
instances... that's the biggest stumbling block afaict. I think it 
makes sense to centralize where possible (as I've tried to get us 
started on)... but not everywhere, 'cause then we can't keep everybody 
happy ;)


James Walker  ::  http://www.walkah.net/

More information about the drupal-devel mailing list