Index: lib/gcstar/GCImport/GCImportTellico.pm
===================================================================
RCS file: /cvs/gcstar/gcstar/lib/gcstar/GCImport/GCImportTellico.pm,v
retrieving revision 1.18
diff -u -u -r1.18 GCImportTellico.pm
--- lib/gcstar/GCImport/GCImportTellico.pm	4 Aug 2007 13:28:57 -0000	1.18
+++ lib/gcstar/GCImport/GCImportTellico.pm	11 Nov 2010 16:47:43 -0000
@@ -30,6 +30,7 @@
 
     use base qw(GCImport::GCImportBaseClass);
     use File::Spec;
+    use File::Copy;
  
     sub new
     {
@@ -128,7 +129,6 @@
             $xml = do {local $/; <XML>};
             close XML;
         }
-	
         #Then we parse XML data
         my $xs = XML::Simple->new;
         my $tellico = $xs->XMLin($xml,
@@ -164,10 +164,15 @@
 	    my $i = 0;
 
 	    my $methodName = 'get'.$self->{extractedModel}.'Item';
-	    
+
+        # get tellico image base dir
+        my $base_dir = $file;
+        $base_dir =~ s/\.tc$//;
+        $base_dir .= '_files';
+
         while (my ($id, $entry) = each (%tmpMap))
         {
-            $result[$i] = $self->$methodName($entry, $collection);
+            $result[$i] = $self->$methodName($entry, $collection,$base_dir);
             $i++;
         }
         return \@result;
@@ -308,8 +313,10 @@
 	
     sub getGCbooksItem
     {
-        my ($self, $entry, $collection) = @_;
-        
+        my ($self, $entry, $collection, $base_dir) = @_;
+
+        use Carp;
+
         my %result;
     
         $result{title} = $entry->{title}->[0];
@@ -338,6 +345,7 @@
         $result{pages} = $entry->{pages}->[0];
         $result{read} = 1 if ($entry->{read}->[0] eq 'true');
         $result{acquisition} = $entry->{pur_date}->[0];
+        $result{isbn} = $entry->{isbn}->[0];
         $result{genre} = [];
         if ($entry->{genres}->[0])
         {
@@ -348,7 +356,7 @@
         }
         $result{rating} = $self->convertRating($entry->{rating}->[0]);
         $result{borrower} = 'Unknown' if ($entry->{loaned}->[0] eq 'true');
-        $result{cover} = $self->getPicture($collection, $entry->{cover}->[0], $result{title});
+        $result{cover} = $self->getPicture($collection, $entry->{cover}->[0], $result{title},$base_dir);
         return \%result;
     }
 
@@ -434,8 +442,8 @@
 
     sub getPicture
     {
-        my ($self, $collection, $imageId, $title) = @_;
-	   
+        my ($self, $collection, $imageId, $title, $base_dir) = @_;
+
 	    my $result = undef;
         if ($imageId && (ref($imageId) ne 'HASH'))
         {
@@ -455,8 +463,10 @@
                 if ($self->{type} eq 'T')
                 {
                     # Only zipped file may have external pictures
-                    my $picName = 'images/'.$imageId;
+                    my $picName = $base_dir . '/'.$imageId;
+                    #???  extractMember does what??
                     $self->{zip}->extractMember($picName, $fileName);
+                    copy($picName,$fileName)
                 }
                 else
                 {
