In an attempt to pick the right module to create & manage photo galleries, after many, many hours of research (read: trying to read everything I could find on galleries) I selected "Node Gallery" as the most promising. And so far it looks to be the right choice.
However, with one element I am struggling right now: with the field type of the "Gallery Media" field set as "File", I can not find a way to set the minimum and maximum image resolution (i.e. pixel sizes). And I really need to put some kind of 'control' on what users can upload to the site, without the need for first using any kind of external editor.

One alternative way to address this, is to create a new field with a field type "Image" (and potentially delete the "Gallery Media" field). But the immediate drawback I see that by doing this, I am losing the "Manage Images" tab that allows mass editing. And I might be 'missing' more (e.g. in the integrated views that come with "Node Gallery"?), but have not spend time yet to find out the hard way...

Just wanted to ask if anybody can answer me on the following question: can I have "best of two worlds", i.e. stick to the out-of-box module, but with a way to manage photo size/resolution? Some pointers are greatly appreciated.

P.S.: The documentation on "Node Gallery" as found here, could really use an update, as to me it looks like it is still merely focused on Drupal 6.

Comments

fredklopper’s picture

+1

Golem07’s picture

I am having similar issues and would love to simply use node gallery with a good old plain image field instead of a file field.

Golem07’s picture

OK - here is what I did on an installation with quite a few galleries and dozens of photos in them.

It seems too easy to not have any drawbacks (have not found any after initial tests):

I went to the database (phpmyadmin) -> field_config -> node_gallery_media (edit) -> changed the "type" and "module" entry manually from "file" to "image".

Then I went to to my site -> content type -> gallery item -> manage fields and found that the type of the node_gallery_media had already changed from "file" to "image" and with two clicks I was able to change the widget type as well.

With this simple step I have all the features of the image field type available (including access to image styles in views and the above mentioned minimum and maximum image resolution etc.) without any loss of data or functionality for image files (so it seems until now). Apparently all my problems with the file field have gone (fingers crossed).

Now my questions to the pros: What kind of demons could I have woken up by manually changing the file type and what will (could) happen when trying to upgrade the module lateron?

Thanks a lot in advance!

sistro’s picture

Golem07 your solution is so simple but so fundamental...

But I would like to know one thing... why did not choose image as default field instead of file???

sistro’s picture

I enjoyed too soon!

I encountered some problems in detail when I try to upload new image I get this error:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node_gallery_media_alt' in 'field list': INSERT INTO {field_data_node_gallery_media} (entity_type, entity_id, revision_id, bundle, delta, language, node_gallery_media_fid, node_gallery_media_alt, node_gallery_media_title, node_gallery_media_width, node_gallery_media_height) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 124 [:db_insert_placeholder_2] => 124 [:db_insert_placeholder_3] => node_gallery_item [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 371 [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => 1920 [:db_insert_placeholder_10] => 2880 ) in field_sql_storage_field_storage_write() (line 494 of /var/www/vhosts/xxx/httpdocs/modules/field/modules/field_sql_storage/field_sql_storage.module)

Golem07’s picture

Hi Sistro,

I cannot check my database right now so here just a quick info: The problems you have are easy to solve, if I recall correctly: After you switch from file field to image field there are some rows of an image field type missing in your database. Simply compare the database of any other image field with your converted file field and manually add the missing rows ones to your database. This is just out of my head and I will need to check myself again.