I'm torn between the image module and embedded gallery.
Embedded gallery has so many more features but lacks the integration that the image module provides. For instance:

1) My users are confused by the difference between gallery comments and Drupal comments. It would be great if users could add Drupal comments on gallery images.
2) Content tracking used by other modules such as user ponits cannot track Gallery content. My users would like to earn points for pictures and picture comments.

It would seem that creating gallery images as Druapl nodes would accomplish this but it sounds difficult. I realize the image module does this but I would loose all of the great features currently only available with G2.

Comments

profix898’s picture

I'm currently working on a module (supplement for gallery.module) to integrate Gallery2 albums/photos as Drupal nodes. As you pointed out this has several advantages. However since it is quite difficult to achieve it will take a while and I'm not even sure this will be available for Drupal 5, because some new features (incl. the new language subsystem) of Drupal 6 simplifies the task a lot.

Gallery nodes in Drupal will provide almost every feature that is available for other content types, like support for taxonomy, comments, views integration, ... but you should be aware that this will not replace Gallery2's UI. For example you will still add/manage your images through the G2 interface. In principle it was possible to manipulate G2 content transparently using a standard Drupal content type, but thats far beyond the scope of my effords. We will still have a 'read-only' integration of Gallery2.

Its not realistic to think of a 'full' integration of Gallery2, where only the Gallery2 backend is used, but the frontend is completely replaced with a Drupal module IMO. I guess this will never happen ...

kylehase’s picture

That sounds exactly like what I'm looking for. I don't think I'm good enough to help you code but i can surely help test if needed. I actually like the G2 UI a lot but it just doesn't fit well with the rest of my Drupal site.

I'm curious what you meant by 'read-only'. I assume the current functionality of the gallery.module will still exist. Is this correct? Will users still be synchronized etc?

profix898’s picture

I'm curious what you meant by 'read-only'. I assume the current functionality of the gallery.module will still exist. Is this correct? Will users still be synchronized etc?

With 'read-only' I tried to describe that you will not be able to change a G2 item through the associated Drupal node. The node in Drupal is more like a mirror of the original G2 item (without duplicating the actual image). And yes, the current functionality of the gallery.module will persist. Optionally what lives under '?q=gallery' may be replaced with a view rendered by the views module ... we will see ...

kylehase’s picture

Sounds good. I'm looking forward to it.

PixelClever’s picture

Just a thought, perhaps there should be some discussion with creators of the g2 image chooser module and the image module. If you think about it, you could adapt the image module to be able to access the g2 galleries, and even automatically create image nodes based on the information coming from g2. By making your module as an add on to the image module people who are already invested in one system or the other would be able to integrate the two without starting over from scratch.

This project is far beyond my php level, but I am willing to contribute monetarily. Is there some way you could set up a chip in fund for this project so that those interested could help it along?

profix898’s picture

Version: 5.x-1.x-dev » master
Assigned: Unassigned » profix898

There already is some discussion going on about better image handling (in core) for Drupal 7. However we must keep in mind that Gallery2 is different from image module or imagecache/imagefield. But surely we should pinpoint what we want and what is possible atm.

G2Image

G2Image is a great tool to insert photos from Gallery2 into a Drupal node. Thats why we officially support it with the main gallery module. We just updated 5.x-2.x specifically for G2Image's latest release (3.0). But G2Image is and must be designed generic because it is used by other G2 integrations like Wordpress as well. So there will likely be no Drupal-specific features in this tool. But yes, the author is in contact with us and other integration developers to further improve G2Image.
The most requested feature is the ability to choose images from a hidden G2 album. This way one could have the usual gallery and a dedicated hidden album to use with G2Image to insert photos (similar to what img_assist does for image module).

Image handling basics

In general there are 2 different ways of implementing image handling in Drupal. A) Images are nodes B) Images are associated with a node, ie. a cck field or a reference to an image in filesystem.

  • Imagecache/imagefield and to some extend IMCE (omitting the fact that IMCE does not maintain a reference to filesystem in the database at all) implement variant B. Images are located in the filesystem and referenced from the node content (IMCE) or from a cck field (imagefield).
  • Image module on the other hand implements an 'image' node type (= variant A). This way the module takes advantage of all feature available for nodes, like comment support, taxonomy support, etc.

Image module

In principle we could adapt image module, but some specialities make it much easier to reimplement the functionality in a separate module IMHO:

  • Image module stores the filesystem path to images (and its derivatives) in the db. For G2 compatibility we would need to introduce an additional abstraction layer so that the module could fetch images from external sources as well.
  • Image module creates derivatives of images itself. G2 provides this functionality as a wrapper around the actual file object.
  • You cant use Drupal upload functionality transparently with G2 and you cant create or manipulate G2 entities from Drupal. At least not without extensive use of GalleryCoreApi and much extra work.
  • For one-to-one entity mapping of G2 to Drupal we need to implement two node types. One for G2 albums and one for G2 photos. Image module implements only one.

Status

I'm currently working on the Drupal 6 version of gallery module (about 95% completed) and I already started to work on gallery_content module as well. At this point it implements two node types for albums/photos (see above) and provides a steady mechanism to mirror the G2 album structure (and images) into Drupal nodes. Thats a nice basis to build upon, but the module is quite useless until access control is implemented.
Other features like a cck reference field for G2 image nodes (basically available through the node reference module in cck package already) or a caching mechanism are almost trivial to implement afterwards.

Advantages of gallery_content

But what are the benefits of a gallery_content module?

  • We get a fully themable gallery (based on the Drupal theme system instead of G2 themes).
  • G2 entities being native Drupal nodes automatically provides all features available for other Drupal node types, e.g. comment support, views support, etc.

BUT there will be no advanced G2 features (like image frames, slideshow, ...) available (at least in the beginning). Some other functionality (like dynamic albums, ...) would be possible using views module. The main interface to G2 items however would still be G2, of course! So this solution is not suited for everyone, but it integrates G2 much better into Drupal for many people.

@vinayakaya:

This project is far beyond my php level, but I am willing to contribute monetarily. Is there some way you could set up a chip in fund for this project so that those interested could help it along?

Actually I'm doing all this work in my free time. I've never thought of getting paid for this and I always enjoyed contributing freely and at no charge to a great project like Drupal. Even being supported monetarily I couldnt guarantee to be able to spend much more time on this module, because my day job (and my girlfriend) are to be paid attention as well. Otherwise setting up ChipIn is easily done.

profix898’s picture

@vinayakaya: I have added information about how to help at the bottom of the project page (http://drupal.org/project/gallery).

profix898’s picture

Its getting closer, but I will need another few weeks before a first version of gallery_content will be available for testing and commenting. However I have implemented the following mapping between G2 and Drupal now:

  • G2 root album => dedicated 'Gallery2' vocabulary
  • G2 albums => terms of 'Gallery2' vocabulary
  • G2 photos => Drupal nodes (of 'gallery' content type)

The 'gallery' content type is the only content type representing G2 items in Drupal. An additional field in the database still allows to distinguish photos, videos and audio. In the first version only images will be supported, but it shouldnt be difficult to add 'display handlers' for other media types as well. I'm currently working on the details of implementation, so that the new content type will work with as much existing modules as possible. It will probably provide 2-3 simple hooks, so that other modules can easily interact with gallery_content. For example it should be possible for lightbox2 to add the required 'lightbox tag' to the images. It should also be possible to override/extend the display handler to render the images and gallery in different ways. IMO its the worst part about image.module that it does not allow other module to hook into.

profix898’s picture

EDIT: As parts of gallery_content depend on cck and views I will need to wait for these modules to be ported for D6 before I can complete an initial version for testing ...

profix898’s picture

alexandreracine’s picture

Wow, this function will be fun to try! I'll be able to try that in December or so. Thanks profix898 for all the updates on where you are at!

najibx’s picture

Subscribing ...

This is great to hear!

Michelle’s picture

I'd drifted away from the gallery module since I screwed up and updated my copy of G2 beyond what the 5.x module can handle so I totally missed this. Having G2 images as nodes would be awesome! I'll have to take a closer look once 6 is out. Thanks!

Michelle

profix898’s picture

Project: Gallery » Gallery Addon
Version: master »
Component: Miscellaneous » Module: Gallery Content

... moving to GalleryAddon issue queue ...

najibx’s picture

currently no release yet. When do you expect it be out?

roleychiu’s picture

Version: » 6.x-1.x-dev

I would also be very interested in this feature.

+1 !!

akolahi’s picture

profix898, Thanks for your hard work on this!!! I think your Gallery_Addon module will be a huge step in making Drupal an ideal choice for multimedia sites. I will be installing your module in the next day or so for testing and to see if it is viable for my needs: mostly the abilty to use Drupal Taxonomy/comments with Gallery

SocialNicheGuru’s picture

subscribing

WesleyTx’s picture

Subscribing ... and very excited!

joyautumn’s picture

Would xaware (www.xaware.org) be useful for streamlining the process of integrating Gallery2 into Drupal? Xaware provides an XML-based method for building (Java) web services that do database synchronization.

I have just posted my initial thoughts on this idea in the Drupal for Education group here:

http://groups.drupal.org/node/10231#comment-45227

But in looking for ways to embed video from Gallery2 into Drupal nodes via TinyMCE I came upon this module of yours. It looks really promising - thank you so much for creating it! I have one site running Drupal 6 that this would be very helpful for. My other sites are in Drupal 5 so they'll have to wait.

inforeto’s picture

The gallery api is too big for short term development but otherwise it'd be great to be make a wrapper for it.

maxchock’s picture

any updates on the OG addon for Gallery2? I have install and configure Gallery2 on my website, and currently is only for individual user gallery. I want to create album/gallery for OG too. So google bring me here. May i know whether the current development release are able to create album for OG?

Thanks.

alexandreracine’s picture

profix898’s picture

G3 is one reason why development of gallery_addon is currently holded for the public. The message about G3 caught me (Oct 29) in the middle of rethinking the integration modules. However, I'm working on a larger reorganization of gallery module and its affiliates. But I'm not sure it it will be G2 compatible, considering the targeted release date of G3 in Feb 2009.
I plan to post at g.d.o. shortly so that everyone receives notice about the future direction of Gallery2/3 (and its Drupal integration).

kylehase’s picture

G3 sounds great. Lately I've been feeling that Gallery has been slapping on features with insufficient architecture and UI planning. A clean slate is just what the project needs.