It seems that all the best image handling modules support "images as nodes" where each image is attached to a separate node. This seems horribly inefficient to me. Whenever displaying an image, a call to the node database is required. (I assume) Since images can be one of the bandwidth hogs of any website, why would one want to add extra queries to displaying a page?

Is there some hidden advantage to "images as nodes" which makes it worth the hit? Or am I mistaken about the extra bandwidth and overhead of displaying an "image as node?"

Comments

WorldFallz’s picture

I don't think it's a matter of better or worse-- it's all about whatever is best for a particular use case. IMO images as nodes makes images a bit easier for non-technical users to use them in posts (see module's like http://drupal.org/project/image_browser). The http://drupal.org/project/imce module, where images are not nodes, is equally as popular as the image module.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

masande’s picture

i con only speak for my own development, but having images exist as nodes allows them to be referenced by as many other nodes as you like. also, views can then be constructed to present images in a plethora of ways.

as a practical example, we built a portfolio and product catalog site using the same image database using this method. images are uploaded once and then presented as 'in use' photos in the product catalog (http://jmfx.net/products/664) and also used as portfolio galleries (http://jmfx.net/portfolio/290).

there are many ways to accomplish in drupal, but this has become our method of choice.

let me know if you have any more questions.

Mark Sanders
Q Collective

Mark Sanders
Q Collective

zoon_unit’s picture

I can see where the image nodes would work well in your situation, since your images are basically products that need to be handled in several contexts.

In a blogging or news site, however, images are usually attached only to specific articles and seldom reused. (and if they are, they can be linked to via a standard url) Since there are tons of blogs and news sites using Drupal, I'm surprised there isn't better support for images as images. For instance, the resizing and manipulation functions of the image and image assist modules would be equally valuable for the "images as images" paradigm. There are modules to support that, but they don't seem nearly as mature as the before-mentioned modules. Even the IMCE module has an unfriendly and foreign browsing interface for most users.

I guess I'm just surprised that this need isn't better supported, especially since I see a lot of other posters complaining about the same limitation. :-)

masande’s picture

there are many helpful case studies buried through drupal.org. one that i think is a good read for you is http://drupal.org/node/233090 which outlines how popular science implemented drupal. there is very extensive documentation of their process.

i'm working on a site currently that uses bueditor and imce for inline image insertion. i have created a custom filter that through imagecache resizes the image to the allotted on-screen space, inlines the image and then allows thickbox to present full-scale version. what you are trying to accomplish is possible but it may take a little invention which is common for drupal.

Mark Sanders
Q Collective

Mark Sanders
Q Collective

konrad1811’s picture

How to reuse image nodes?
As far as I know I can just attach image (upload image).
But I haven't found how to attach image that already exist...?
At least no in easy way...
Is there a special module or You have written a lot of code to handle this?