Advanced search  

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]

Pages: [1] 2   Go Down

Author Topic: Upload descriptions and pictures  (Read 54203 times)

0 Members and 2 Guests are viewing this topic.

coppermineuk

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Upload descriptions and pictures
« on: February 24, 2005, 12:40:48 pm »

I am hoping to find a method to up load images and their description data to simplify the upload process (perhaps from a text file listing descriptions and filenames). The product is so good I'm sure that this must be possible but I cannot find anything in the FAQs and Documentation.

Can you help?
« Last Edit: February 25, 2005, 04:56:48 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Upload descriptions and pictures
« Reply #1 on: February 24, 2005, 12:48:55 pm »

no, such a method doesn't exist; at least I don't know a mod that will accomplish this.

Joachim
Logged

coppermineuk

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Upload descriptions and pictures
« Reply #2 on: February 24, 2005, 01:14:54 pm »

Ok and thanks - At least I know I looked hard enough  ;D

I think that it would be useful feature.
Logged

Nibbler

  • Guest
Re: Upload descriptions and pictures
« Reply #3 on: February 24, 2005, 06:28:38 pm »

If you give more details of what exactly you want, maybe someone will make a mod. :)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Upload descriptions and pictures
« Reply #4 on: February 25, 2005, 01:12:11 pm »

I guess coppermineuk is refering to something like a csv file to be ftp-uploaded along with the pics that should then hold the title and description of the text. The batch-add screen is then suppossed to look for this particular text file (which might need a defined name) and add the text contained inside the file to the database. I'm not sure how the correlation between the pic file names and the text entries is suppossed to work though. Another option would be (maybe inside "admin tools") to have a little routine that adds a certain line of text (title and/or description) to a whole bunch of pics/files at once, using the coppermine ui (some thumbs with checkboxes and a <textarea> would be all it takes...
Food for thoughts imo, might be a nice mod or future feature - why not add it to the dev todo list maybe?

Joachim
Logged

coppermineuk

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Upload descriptions and pictures
« Reply #5 on: February 25, 2005, 01:46:12 pm »

Gau Gau was about right,

In my example all of my photos have unique filenames - My digital camera sees to that.

What I was hoping to do is keep an offline register of my photos, their titles, their descriptions etc. in a database or excel file. I could then easily export this to a CSV file containing entries such as ;

Filename,Title,Description
IMG101_1044,My Photo,This is a description of my photo.

If this csv file was uploaded then as part of the batch add process coppermine could check for entries in the CSV file for any photos uploaded and then automatically populate the descriptions.

Does that make sense?  ???
Paul
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Upload descriptions and pictures
« Reply #6 on: February 25, 2005, 04:56:16 pm »

sounds like a good idea to me, I'll movbe this thread from "CPG 1.3 Standalone Support" -> "Upload" to "Feature requests" then and mark as "Valid". You (or anyone else reading this thread) are welcome to post a mod/jack to accomplish what you're requesting. We currently have a feature freeze for the devel version (we're planning to release soon), so this probably won't be done anytime soon by a dev team member.

Joachim
Logged

pnear

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 35
    • http://www.thenears.com
Re: Upload descriptions and pictures
« Reply #7 on: February 26, 2005, 10:51:55 pm »

I accomplish this using IPTC embedded information for description, keywords, etc.  The advantage of this approach is that it's future-proof and accomplishes the same goal that you're alluding to. Instead of the information living in a text file (the format of which may always be different) it lives within the image itself.  This makes maintenance and more importantly portability of the image seamless.  I personally use Adobe photoshop elements to maintain my image library, which has great organization tools and writes info out to IPTC.  Alternatively there are free tools like pixvue or exifer that can maintain this info as well.  Coppermine understands IPTC and support for it appears to be growing in future versions of Coppermine. 

Personally, I'd like to provide users with a tutorial on how to use IPTC including:
- What is IPTC
- What tools can I use to maintain IPTC information
- How does Coppermine use IPTC information

Yes, that is the sound of me volunteering.  Ping me back when you're looking to release 1.4 tutorials and I'll happily write a tutorial.

More pontification on this subject here:
http://www.thenears.com/index.php?p=84

Pete
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Upload descriptions and pictures
« Reply #8 on: February 26, 2005, 11:05:31 pm »

tutorials would be very welcome indeed, even before the release of cpg1.4 ;) The features should be stable (we had a feature freeze), there's only some bugs to be ironed out and then the translation can start.

Joachim
Logged

pnear

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 35
    • http://www.thenears.com
Re: Upload descriptions and pictures
« Reply #9 on: February 26, 2005, 11:12:52 pm »

I'll do what I can based on tutorial templates already posted.  Finding the time might be the issue, but I'll add it to the task list.

Pete
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Upload descriptions and pictures
« Reply #10 on: February 26, 2005, 11:21:37 pm »

you might want to take a look at wink, which I used to create the flashed tutorials.

Joachim
Logged

Whisper_MCO

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Upload descriptions and pictures
« Reply #11 on: March 03, 2005, 07:16:19 pm »

I accomplish this using IPTC embedded information for description, keywords, etc.  The advantage of this approach is that it's future-proof and accomplishes the same goal that you're alluding to. Instead of the information living in a text file (the format of which may always be different) it lives within the image itself.  This makes maintenance and more importantly portability of the image seamless.

Pete

I love the above idea, but still really need the CSV feature. I receive hundreds of photos at a time, with request to post quickly. I can easily create a csv file in 10 minutes or less, but embedding IPTC info in each photo would take hours. (Unless you have a batch program for this? Which uses a CSV import?)

We will shortly be moving the site to Coppermine (as a rush job), and have 4-5 thousand photos with info required to be attached. :(
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Upload descriptions and pictures
« Reply #12 on: March 04, 2005, 07:21:04 am »

Don't expect coppermine dev team members to come up with the requested hack any time soon, as we're busy fixing bugs for cpg1.4 to have a release soon. If you urgently need the hack, I suggest you code it yourself or you hire someone to code it for you.

Joachim
Logged

Dave_Logic

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Upload descriptions and pictures
« Reply #13 on: March 09, 2005, 12:02:17 pm »

That's a shame...Most of the other Gallery scripts appear to have a "default" decsription, title etc for batch uploads per albulm folder. This seriously cut down a lot time..I need to port over about 15,000 images to CM but will never achieve my goal without this feaure...
Logged

Nibbler

  • Guest
Re: Upload descriptions and pictures
« Reply #14 on: March 09, 2005, 03:33:41 pm »

OK, this is a pretty simple mod:

include/picmgmt.inc.php

find:

Code: [Select]
// Test if disk quota exceeded
and add just before it

Code: [Select]
if ($csv_data = csv_import($filename, $CONFIG['fullpath'] . $filepath)) list($title, $caption) = $csv_data;
and in the end of the file, just before the closing ?> tag add the new function:

Code: [Select]
function csv_import($fname, $filepath)
{
// adjust these to suit - default value will match -> "filename.jpg","my title","my description"
$csvfile = 'files.csv';
$field_delim = ',';
$text_delim = '"';

if (file_exists($filepath . $csvfile)){
$data = file($filepath . $csvfile);
$csv = array();
foreach ($data as $line){
list($filename, $title, $desc) = explode($field_delim, $line);;
$csv[trim($filename, $text_delim)] = array(trim($title, $text_delim), trim($desc, "$text_delim\x00..\x1F"));
}
if (isset($csv[$fname])) return $csv[$fname];
}
return false;
}

Upload the csv file, by default 'files.csv' in the same directory as your batch add folder, but try not to actually batch add the csv file itself. ;)

The options at the top of the new function should let you read the file correctly if you set the right delimiters, although I only tested it with OpenOffice.org csv files.
« Last Edit: March 09, 2005, 04:00:55 pm by Nibbler »
Logged

Dave_Logic

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Upload descriptions and pictures
« Reply #15 on: March 09, 2005, 06:49:36 pm »

OK, this is a pretty simple mod:

include/picmgmt.inc.php

find:

Code: [Select]
// Test if disk quota exceeded
and add just before it

Code: [Select]
if ($csv_data = csv_import($filename, $CONFIG['fullpath'] . $filepath)) list($title, $caption) = $csv_data;
and in the end of the file, just before the closing ?> tag add the new function:

Code: [Select]
function csv_import($fname, $filepath)
{
// adjust these to suit - default value will match -> "filename.jpg","my title","my description"
$csvfile = 'files.csv';
$field_delim = ',';
$text_delim = '"';

if (file_exists($filepath . $csvfile)){
$data = file($filepath . $csvfile);
$csv = array();
foreach ($data as $line){
list($filename, $title, $desc) = explode($field_delim, $line);;
$csv[trim($filename, $text_delim)] = array(trim($title, $text_delim), trim($desc, "$text_delim\x00..\x1F"));
}
if (isset($csv[$fname])) return $csv[$fname];
}
return false;
}

Upload the csv file, by default 'files.csv' in the same directory as your batch add folder, but try not to actually batch add the csv file itself. ;)

The options at the top of the new function should let you read the file correctly if you set the right delimiters, although I only tested it with OpenOffice.org csv files.

Thanks a many - will try as soon as I get in......what is the format of the CSV??
Imagename, Description ???
Logged

Dave_Logic

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Upload descriptions and pictures
« Reply #16 on: March 10, 2005, 01:23:43 am »

OK, this is a pretty simple mod:

include/picmgmt.inc.php

find:

Code: [Select]
// Test if disk quota exceeded
and add just before it

Code: [Select]
if ($csv_data = csv_import($filename, $CONFIG['fullpath'] . $filepath)) list($title, $caption) = $csv_data;
and in the end of the file, just before the closing ?> tag add the new function:

Code: [Select]
function csv_import($fname, $filepath)
{
// adjust these to suit - default value will match -> "filename.jpg","my title","my description"
$csvfile = 'files.csv';
$field_delim = ',';
$text_delim = '"';

if (file_exists($filepath . $csvfile)){
$data = file($filepath . $csvfile);
$csv = array();
foreach ($data as $line){
list($filename, $title, $desc) = explode($field_delim, $line);;
$csv[trim($filename, $text_delim)] = array(trim($title, $text_delim), trim($desc, "$text_delim\x00..\x1F"));
}
if (isset($csv[$fname])) return $csv[$fname];
}
return false;
}

Upload the csv file, by default 'files.csv' in the same directory as your batch add folder, but try not to actually batch add the csv file itself. ;)

The options at the top of the new function should let you read the file correctly if you set the right delimiters, although I only tested it with OpenOffice.org csv files.

Thanks a many - will try as soon as I get in......what is the format of the CSV??
Imagename, Description ???

Firstly...Many many thanks - It works perfectly, in fact I'm very surprised just how faultless that was!!!...Maybe I'm pushing my luck but how hard would it be to include the keywords and even possibly the custom fields??? I've tried appending the $keywords and $user 1... 4 to your code but no joy...

EDIT >>>> Spoke too soon..Worked it out...........Many thanks indeed...!!
« Last Edit: March 10, 2005, 01:44:28 am by Dave_Logic »
Logged

MerNion

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Upload descriptions and pictures
« Reply #17 on: April 26, 2005, 11:46:53 pm »

I have altered the function to include keywords as well... if anyone is interested here it is (i hope there aren't any mistakes):
Code: [Select]
function csv_import($fname, $filepath)
{
// adjust these to suit - default value will match -> "filename.jpg","my title","my description","keyword1 keyword2 etc"
$csvfile = 'files.csv';
$field_delim = ',';
$text_delim = '"';

if (file_exists($filepath . $csvfile)){
$data = file($filepath . $csvfile);
$csv = array();
foreach ($data as $line){
list($filename, $title, $desc, $keywrd) = explode($field_delim, $line);;
$csv[trim($filename, $text_delim)] = array(trim($title, $text_delim), trim($desc, "$text_delim\x00..\x1F"), trim($keywrd, "$text_delim\x00..\x1F"));
}
if (isset($csv[$fname])) return $csv[$fname];
}
return false;
}
Logged

rachel75

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Upload descriptions and pictures
« Reply #18 on: March 16, 2007, 02:36:29 am »

If anyone is still looking at this thread, I wonder if you might help clarify something for me.
First, I created additional custom fields following these instructions: http://forum.coppermine-gallery.net/index.php?topic=35263.0

Then I added the code in this thread to allow for uploading data along with my images. The title and description upload properly, but none of my custom field data uploads. I have a feeling I am probably making a simple mistake somewhere along the way, but I can't figure it out. The code I used is:
Code: [Select]
function csv_import($fname, $filepath)
{
// adjust these to suit - default value will match -> "filename.jpg","my title","my description", "my custom fields"
$csvfile = 'files.csv';
$field_delim = ',';
$text_delim = '"';

if (file_exists($filepath . $csvfile)){
$data = file($filepath . $csvfile);
$csv = array();
foreach ($data as $line){
list($filename, $title, $desc, $user1, $user2, $user3, $user4, $user5, $user6, $user7) = explode($field_delim, $line);;
$csv[trim($filename, $text_delim)] = array(trim($title, $text_delim), trim($desc, "$text_delim\x00..\x1F"), trim($user1, "$text_delim\x00..\x1F"), trim($user2, "$text_delim\x00..\x1F"), trim($user3, "$text_delim\x00..\x1F"), trim($user4, "$text_delim\x00..\x1F"), trim($user5, "$text_delim\x00..\x1F"), trim($user6, "$text_delim\x00..\x1F"), trim($user7, "$text_delim\x00..\x1F"));
}
if (isset($csv[$fname])) return $csv[$fname];
}
return false;
}

Any ideas?
Mahalo.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Upload descriptions and pictures
« Reply #19 on: March 16, 2007, 09:24:08 am »

This is not a support thread!
Logged
Pages: [1] 2   Go Up
 

Page created in 0.036 seconds with 20 queries.