coppermine-gallery.com/forum

No Support => Feature requests => Topic started by: OmegaGOD on April 14, 2004, 08:07:02 PM

Title: Images in Multiple Albums
Post by: OmegaGOD on April 14, 2004, 08:07:02 PM
Is there any way someone could include an option in CPG1.3 so that one could add one image to multiple albums. I have been uploading mutliple copies of the same image onto my webserver and it's now getting out of hand. For example: If I have a picture of the Empire State Building, I would like to be able to add that one image to my NYC album, Vacations album, and say SpringBreak2004 album. It shouldn't be that complicated since it's a SQL database; however I'm not too well versed in how coppermine adds images to the database. --Thanks a bunch

Here's an idea for a solution. It probably won't work but I thought I'd pose it. All the data except for the images are stored in the SQL database. Can we make a table in the database called albums. In this field all the albums that a said image is included under is listed here. This way if one deletes the images from one album, it will just delete the "album" from the table and if there is only one album listed for a given image, then it will delete the image file itself.
Good? Bad? Have no idea what I'm taking about?
Title: Images in Multiple Albums
Post by: Casper on April 14, 2004, 08:26:09 PM
This has been discussed a few times, and is almost ready.  Tarique has done this, and will be releasing the mod shortly after the stable release of version 1.3.  Not long now.
Title: Re: Images in Multiple Albums
Post by: STRiDOR on May 03, 2004, 05:35:39 PM
Hot diggedy damn..  I'm happy now, well I will be when I get the mod.  Is there a chance to get it now?

I have a mod working now that will do this, problem is I can't share comments, votes etc easily between the same pic in different albums, but at least only one pic has to be on my server!  So if Tarique has implemented a version that addresses my PHP shortcomings, happy days are here.  :)
Title: Re: Images in Multiple Albums
Post by: OmegaGOD on May 12, 2004, 07:56:44 AM
Thanks to Tarique for implementing this request into a MOD. Is there a "beta" version of the mod I could try on my current CPG? --Thanks
Title: Re: Images in Multiple Albums
Post by: Tarique Sani on May 12, 2004, 08:52:40 AM
This is not a MOD but an implementation in the main software (due to the numerous changes needed) and no there is no Beta available as yet - you can only see a demo  ...
Title: Re: Images in Multiple Albums
Post by: STRiDOR on May 13, 2004, 12:48:31 AM
Your last sentence begs for the obvious next question.  Where can we see a demo in action?  And when do you think we'll all get to download a version of CPG with these changes implemented? 

Title: Re: Images in Multiple Albums
Post by: Tarique Sani on May 13, 2004, 07:15:35 AM
See demo at  http://tariquesani.net/index.php?cat=5 There are 2 Albums "Little Brown Dove" and "Myna"

The first album it says 2 pictures but when you click you will see 6 pictures - The other 4 are comming from the Album "Feeding Station"  because those 4 pictures have a keyword "dove" which is same as the keyword for the album. Same is true for the Myna album but in this case it is the pictures with the keyword "myna"

As you can see that this is 98% complete - you will get to download this when it is 100% complete, OR probably the next version, when will it be 100% complete.... I don't know :)
Title: Re: Images in Multiple Albums
Post by: OmegaGOD on May 22, 2004, 07:20:43 AM
Tarique, it looks great. Thanks for working to implement this. May I ask a quick question? When you go to the Myna album, and select the third image, entitled "Jungle Myna", upon opening the image, the location bar says "Home > Garden Wildlife > Feeding Station" instead of "Home > Garden Wildlife > Myna" I am assuming that this is because this image's "main" location is in the "Feeding Station" album. Is there a way to have coppermine's breadcrumb to say "Home > Garden Wildlife > Myna" this way the user who is browsing through the photo album still sees that he/she is in the Myna album? Thanks a bunch! If this is not possible, no problem, just thought I'd inquire. I look forward to using the modificiation
Title: Re: Images in Multiple Albums
Post by: Casper on May 22, 2004, 12:03:32 PM
Although the breadcrumb shows the main album, the image links, next/previous buttons, file icon button etc, refer to the 'myna' album.
This is the same as if you used the search function.
Title: Re: Images in Multiple Albums
Post by: OmegaGOD on June 11, 2004, 06:48:55 AM
Hey Tarique,
    I just installed the new verision of CPG 1.30. I was wondering if the modification that allows images to be shared in multiple albums has also been included in this release? If not I was wondering if there was a timetable for its release.

Thanks
:) OmegaGOD
Title: Re: Images in Multiple Albums
Post by: Tarique Sani on June 11, 2004, 06:55:20 AM
Hey Hey! 1.3 was release a few hours ago - I have to tidy up the CVS before I can put anything new into it.

Also there is a question about picture count in album stats not showing the pictures taken from other album etc...

But I can say sometime next week if all goes well
Title: Re: Images in Multiple Albums
Post by: pootle on June 12, 2004, 12:22:47 AM
This looks really interesting, I regard one photo appearing in many places as a fundamental requirement, however I think this way of implementing it is a bit restrictive.  Don't get me wrong - this is good - but doesn't do all that could be useful.

having to change the properties of the photo to make it appear in a new album I thinks is limiting - what if it someone else 'owns' the picture?

I think ideally I'd like to just be able to add pictures to some new album, without having to mess with the individual picture.
Title: Re: Images in Multiple Albums
Post by: OmegaGOD on June 12, 2004, 04:05:45 AM
Hi Tarique,
     Thanks a bunch. I look forward for the release. Thanks a bunch for putting it together. :-)
Title: Re: Images in Multiple Albums
Post by: Tarique Sani on June 12, 2004, 04:31:32 AM
Quote from: pootle on June 12, 2004, 12:22:47 AM
having to change the properties of the photo to make it appear in a new album I thinks is limiting - what if it someone else 'owns' the picture?
that means you are not entitled to it in the first place....
Title: Re: Images in Multiple Albums
Post by: GGallery on June 12, 2004, 06:34:39 AM
oh man I'd love to see that feature and I think it would make sense for a lot of setups:

- users are uploading whatever pics they want.
- the "best" pics are getting published/selected by admins into category/subcategory/album

==> users would get a lot of freedom while they also could work on some kind of 'wikimedia' like setup featuring the most accurate/uptodate photos and info on certain topics.
Title: Re: Images in Multiple Albums
Post by: OmegaGOD on June 21, 2004, 09:42:44 AM
Hey Tarique,
     Will the finished modifications be available from CVS or it be rolled out in a later version of CPG? May I also ask if there will be documentation to support the addition? Thanks Again.
Title: Re: Images in Multiple Albums
Post by: Tarique Sani on June 21, 2004, 09:50:33 AM
Quote from: OmegaGOD on June 21, 2004, 09:42:44 AM
Will the finished modifications be available from CVS or it be rolled out in a later version of CPG? May I also ask if there will be documentation to support the addition?
The mod is already there in the CVS for most of the parts - do a check out of  devel - run update.php

The albums table should now have a field called keyword, put a keyword from a picture not in the same album here (use phpMyAdmin to see and edit)

Browse over to that album - the picture from other album (which is not in the modified album) should appear on the thumbnails page.

There will b documentation available ultimately BUT currently the above is the best there is....
Title: Re: Images in Multiple Albums
Post by: DeadKenny on June 21, 2004, 01:24:54 PM
So is this in CPG1.3.0 and are you saying we have to hack the database to get it to work?
Title: Re: Images in Multiple Albums
Post by: Joachim Müller on June 21, 2004, 01:53:59 PM
No, this is not in cpg1.3.0 and you must not hack anything. This is under development and recommended for very experienced users and devs. No questions will be answered on this - if you chose to check out the devel branch of the cvs, you're on your own.
I strongly recommend you don't touch it at all and wait at least for a packaged public beta.

GauGau
Title: Re: Images in Multiple Albums
Post by: Tarique Sani on June 21, 2004, 03:14:31 PM
Quote from: DeadKenny on June 21, 2004, 01:24:54 PM
So is this in CPG1.3.0 and are you saying we have to hack the database to get it to work?
I am saying what I have said above  :P - if you have got doubts about comprehending any of the above it is strongly recommended you do not use it any of the code in CVS devel - It comes with absolutely *0* <- Zero support
Title: Re: Images in Multiple Albums
Post by: DeadKenny on July 28, 2004, 06:58:34 PM
So, same question but for 1.3.1. Is this in 1.3.1?

If not, can we get it somehow as I'd really like this feature?


I'd basically like to have a "best of" gallery that features on the home page of Coppermine so I can show off the best pics, and have the full albums in sub-categories for those who want to browse them. I don't want to have to upload pics twice to do that though or risk deleting the source pic if I delete it from one album when it's also in another.
Title: Re: Images in Multiple Albums
Post by: Joachim Müller on July 28, 2004, 08:10:55 PM
It's not in cpg1.3.x, it's only in the version which is currently under development (and the feature isn't mature yet, needs tweaking). You're free to check the devel version out, using anonymous cvs, but remember that there's no support for devel versions.

GauGau
Title: Re: Images in Multiple Albums
Post by: TC on August 05, 2004, 12:44:09 PM
If I understand you correctly then it picks up which albums an image should be added into based on keywords?
Wouldn't it be better to make this a feature of the database structure?
Right now there are 2 tables, albums and pictures which are linked together using the aid field in the pictures table pointing at the correct album.
To give the most flexibility it would be even better to remove the aid field from pictures and create a new table called album_pictures. This would have at least 2 fields, aid for the album and pid for the image. Using this structure you can easily specify that a picture belongs to more than one album.

To make this work there are two main changes required to the code. Any queries right now which use "where aid =" would have to change to add an extra join to use the new table to get that info.

The biggest change is an interface change to allow images to easily be added to more than 1 album. The idea of using keywords does make it easy to add an image to another album, but you have to type in the correct keywords each time. By doing it with the method I describe it would be easy to set up a drop down box which allows you to select another album to add this image to.
You could even change the upload mechanism to allow multiple albums to be selected.

Finally the keywords idea for associating images with multiple albums is a really good one. Maybe you have an automatic system which takes keywords out of the exif comments in an uploaded image and automatically adds the image to the correct album based on keywords?

Sorry to say that your solution isn't the best but it looks like a mod rather than something built into the system which maybe this should be.
Title: Re: Images in Multiple Albums
Post by: Tarique Sani on August 05, 2004, 12:50:44 PM
Good idea TC - volunteering to code it?
Title: Re: Images in Multiple Albums
Post by: TC on August 05, 2004, 01:07:04 PM
Quote from: Tarique Sani on August 05, 2004, 12:50:44 PM
Good idea TC - volunteering to code it?
I do write this kind of thing for a living so yes I would definitely like to get involved. My only concern would be that it involves such a big change to the code that it can't be handled as a mod.
I did a quick grep to find where the pictures are accessed using the aid field:
find . -name "*.php" -exec grep TABLE_PICTURES.*aid {} \;
(that doesn't catch all of them but it was enough to start with)
That shows there is a LOT of work required to be able to change the underlying database structure to handle the idea of a 1 to many relationship for photograqphs and albums.

I've already posted another thread about smart albums which might mean that these changes aren't necessary to give coppermine this kind of fucntionality.
Have a look at it here and let me know what you think:
http://forum.coppermine-gallery.net/index.php?topic=8575.0
Title: Re: Images in Multiple Albums
Post by: Casper on August 05, 2004, 01:28:20 PM
I wish I'd read this thread first, as I just replied to your smart album thread without knowing about this chat. :D
Title: Re: Images in Multiple Albums
Post by: Tarique Sani on August 05, 2004, 01:32:52 PM
Quote from: TC on August 05, 2004, 01:07:04 PM
That shows there is a LOT of work required to be able to change the underlying database structure to handle the idea of a 1 to many relationship for photograqphs and albums.
Now you will also understand why I am opting for an easy way out :) The idea you suggest is good BUT the amount of work involved and then the possibility of bugs being introduced due to these changes which turn up in wierd places! The code is already a mess and we also have to keep  it backward compatible for easy upgrades.

We are  planning a tentative version 2.0 things there will b very different...
Title: Re: Images in Multiple Albums
Post by: Tarique Sani on August 05, 2004, 01:41:40 PM
Also your idea implies that the albums will have to be selected for placing pictures - you are over looking installs where there are 100s of albums. having 10s dropdowns with all those albums will make the pages a couple of 100 kb (like it has happened to Oasis) - with key word all you have to ensure that the keyword is spelled correctly - for that I have created a key word dictionary which accumulates all the keywords that have been previously placed for pictures and a key word inserter which allows putting keywords from a pop-up list....



Title: Re: Images in Multiple Albums
Post by: TC on August 06, 2004, 02:20:18 AM
There are javascript tricks you could use to only have the list once as a javascript array and then populate all the drop down menus from that. That would allow you to load it just once per page.
It was just an idea for adding images to multiple albums, but I do prefer the idea of keywords. I would have the keywords already in the exif comments as it gives a lot of freedom for people to setup their own workflows for doing this rather than having to type in the keywords for every image they upload.

There are a few threads going on which could link together to make the organisation of images much easier, basically the ideas of multiple albums for each image and automatic organisation based on image meta data (including EXIF time data and keywords).
Title: Re: Images in Multiple Albums
Post by: Tarique Sani on August 06, 2004, 07:02:57 AM
@TC - perhaps you would like to do a checkout of the devel from CVS and see what already works, basically it is the metablums and stats which need to be tweaked for same image in multiple albums
Title: Re: Images in Multiple Albums
Post by: STRiDOR on September 21, 2004, 06:12:48 PM
Hey Tarique, any update on an ETA for the mod?  I'm still waiting patiently..    ::)
Title: Re: Images in Multiple Albums
Post by: Casper on September 21, 2004, 06:29:29 PM
This is in the development version ( 1.4 ).  It will not be released as a mod prior to that.

A non-public beta will be released soon to testers, but don't know how long before a public release.

You can get the dev version from the cvs, but please understand, there is absolutely no support for it until the public release, as it is meant only for experienced users.
Title: Re: Images in Multiple Albums
Post by: ignasi_salvador on November 10, 2004, 01:14:10 PM
I would like to add something new to this whole story.

We developed some years ago a gallery called K-OS catserver.ingenieriasinfronteras.org/k-os (http://catserver.ingenieriasinfronteras.org/k-os) .

We did that because we wanted to have several pictures classified per different parameters; for exampleL: water supply, b/w, nicaragua.

Besides this we wanted to be able to get all pictures in Water(including those which have water supply, water tratment, pumps, etc).

What we did is the following:
- Table 1: Pictures. All information of pictures: date, size, contributor, etc
- Table 2: Words. To make a tree of words so you could have Water/Supply/Pump/Manual, for example; or Location/Central America/Nicaragua/Chontales.
- Table 3L: Words_Pictures. With all relations between words and pictures.

In this way we could easyly list all pictures we were looking for.

Furthermore, if you are an administrator, you can add/delete words and assign a word to several pictures at the same time.

The idea is that if you search for pictures of Manual Pumps, you search the pictures, and once you find them, you can add the word Manual in the Tree and assign that word to those pictures.

I think something similar to this would be really really really helpful for many people.

Our problem is that we are not very good programmers and the final K-OS is quite a mess. We programed it because we didn't find this functionality in any gallery available in the web.

Finally I would just like to add that we did this under GNU license so, if you are interested, I can send you the code.

Ignasi