Bulk Importing of pictures, thumbnails and captions created with Gallery Mage Bulk Importing of pictures, thumbnails and captions created with Gallery Mage
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Bulk Importing of pictures, thumbnails and captions created with Gallery Mage

Started by willdenniss, April 01, 2005, 09:20:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

willdenniss

Hi,

I am not a user of Coppermine, but someone who has written an open source gallery processing tool named Gallery Mage.  This tool is able to process galleries of images including the ability to exclude unwanted images, rotate, crop and resize (see the web site for more info: http://tanksoftware.com/gallmage/ [note: the user manual is out of date, the draft of the new user manual can be found here]).  The program provides official support for the SPGM gallery tool, although some of my users have found the tool useful with Coppermine as well.

What I am proposing is more complete support for Coppermine by Gallery Mage, and vice versa (hence my choice of forum).

From reading the documentation, Coppermine appears to be able to batch import a folder of images.  This is great, as that is exactly what Gallery Mage generates (and can upload).  What I couldn't see, is an easy way to import captions.  Using Gallery Mage, users can caption their photos.  One advantage of this is that Gallery Mage is not coupled to any particular display library, so if users wish to change, they can simply re-export and reupload.  For example, I use SPGM for my personal galleries, but if I wanted, I could re-export to Coppermine, captions and all.

I have several ideas on how we can achieve this, but I thought I would just test the water first and see if there is interest.  If the Coppermine dev's are interested in creating a standard coppermine caption text import format, I can code an exporter to this format for Gallery Mage.

Kind Regards,


William Denniss.
Gallery Mage - Photo gallery processing tool

Tarique Sani

The next version of Coppermine proposes to have a proper XML-RPC API, however there is nothing to stop anyone from implementing what you are talking about - It would be a rather cool feature to have :)

Tell us more
SANIsoft PHP applications for E Biz

willdenniss

I think the simplest way to be able to import captions would be to have a caption format that looked something like the following:


--------gallery_captions.txt------------
[MyPhotos-001.jpg]
This photo is of me and my dog.

[MyPhotos-002.jpg]
This is another photo of my and my dog.
She's a lovely dog isn't she?

-----------end-----------------


or even:


MyPhotos-002.jpg | This is a photo of me and my dog.
MyPhotos-003.jpg | Here's another photo
MyPhotos-004.jpg | and another!


The latter format is what SPGM uses.  The limitation is that you can't add line breaks, although these need to be inteperated anyway (as HTML won't display them).  One solution is simply for gallery mage to replace all '\n''s with "<br />"'s, or just ignore them.


Can one currently batch import thumbnails with Coppermine?  I can easily configure my program to create "thumb_<filename>.jpg" style captions.  I'm not even sure how nessesary this particular feature is if thumbnail generation is simple enough in Coppermine anyway.  If the user wan't generating images, would they even need to have GD installed?  This could be advantageous to those who for whatever reason do not.


Ideally then, the user can export all images, thubmanils, captions into a folder, which is then uploaded (either using Gallery Mage, or their FTP client).

Then the user simply logs on to Coppermine, and creates a new Gallery importing everything.  When you implement an XML-RPC API, Gallery Mage could even do this final step automatically by sending via XML-RPC the location of the files, and the gallery name and caption (I suppose).

What do you think?

Cheers,

Will.
Gallery Mage - Photo gallery processing tool

Tarique Sani

I presume that SPGM does not need user permissions OR Album /  Categories it just uses the Directory structure - am I correct?

Right now Coppermine does not import thumbnails but generates them when batch uploading...

Yes, using XML-RPC It is presumed one will be able to Post the image/files and other info directly to Coppermine.

So are you willing to code the Export to Coppermine for your Gallery Mage?  - Once again I feel it will make a nice addition
SANIsoft PHP applications for E Biz

willdenniss

That's correct regarding SPGM.

Regarding thubmanils, that's fine, the Coppermine Gallery Mage plugin can simply not export thumbnails, this will make the exporting process a bit faster.

Regarding XML-RPC, that's great.  Certainly something I can add to the Coppermine GM plugin once ready.  I've used XML-RPC before and like it.

I am certainly willing to code a Coppermine export plugin for GM. thank you, I hope people will find it useful :)

What are your thoughts on the caption importing into Coppermine?  I this something that can easily be added to the batch upload proceedure by a Coppermine dev?

Cheers,

Will.
Gallery Mage - Photo gallery processing tool

Tarique Sani

Importing a caption by reading a text file should not be too difficult - however tying it to batch uploads might involve jumping through a few more hoops - but yes it is possible
SANIsoft PHP applications for E Biz

willdenniss

What would be the easiest way to do it?  The other choice would be to have one caption text file per image, e.g. "MyPicture-001.jpg.txt".  That way it would be just a simple "file_get_contents", assuming it's easy enough to get the data into MySQL.

Will.
Gallery Mage - Photo gallery processing tool

Tarique Sani

MyPhotos-002.jpg | This is a photo of me and my dog.
MyPhotos-003.jpg | Here's another photo
MyPhotos-004.jpg | and another!

this format would be the most easy to handle.
SANIsoft PHP applications for E Biz

willdenniss

ok, well I shall add a Coppermine exporter to Gallery Mage which exports pictures without thubmanils, and captions in that format.

Hopefully one of the Coppermine dev's can add a caption importer, either as part of the bulk importer, or as a seperate feature.

Cheers,

Will.
Gallery Mage - Photo gallery processing tool

Tarique Sani

Great looking forward to it - will defienitely put in a request to have a caption importer created
SANIsoft PHP applications for E Biz

willdenniss

Download version 2.4.1 with Coppermine support here:  http://tanksoftware.com/gallmage/

Have a read of the *new* included manual, but basically you load and export like so:

Gallery->Open Gallery    - select image directory
Export->Coppermine      - select export directory (the default is ./export), and click OK

Images are exported, and a caption file named 'pic-desc.txt' is created.  Of course, the name of the caption file can be what ever we like :)

There's nothing to stop one using it with Coppermine as it stands, but caption importing would be really nice.

Cheers,

Will.
Gallery Mage - Photo gallery processing tool