source: gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes-and-performers/prepare/01-ARCHIVE-TO-ITEM.sh@ 37121

Last change on this file since 37121 was 37121, checked in by davidb, 16 months ago

Change of name of collection to reflect the planned move to have programmes and metadata about performers together in one collection

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/bash
2
3# HMS_1/HMS_1.pdf
4
5if [ ! -d Items ] ; then
6 echo ""
7 echo "Creating directory: Items"
8 echo ""
9 mkdir Items
10fi
11
12#for full_archive_dir in Archive/HMS_*[0-9] Archives/BMS_[0-9]_[0-9]_*[0-9] ; do
13for full_archive_dir in Archive/* ; do
14 echo "Processing $full_archive_dir"
15 archive_dir=${full_archive_dir##*/}
16 vol=${archive_dir#*_}
17
18 full_item_dir=Items/${archive_dir}
19 item_dir=${archive_dir}
20
21 /bin/rm -rf $full_item_dir
22 mkdir $full_item_dir
23 #mkdir $full_item_dir/TIFFs
24 mkdir $full_item_dir/JPEGs
25
26 full_item_filename=$full_item_dir/$archive_dir.item
27
28 echo ""
29 echo "Generating $full_item_filename"
30 echo ""
31
32 echo "<Volume>$vol" > $full_item_filename
33
34 #images=$(cd $full_archive_dir/TIFFs && ls ${archive_dir}_[0-9][0-9][0-9][0-9].tif)
35 #images=$(cd $full_archive_dir/JPEGs && ls ${archive_dir}_[0-9][0-9][0-9][0-9].jpg)
36 images=$(cd $full_archive_dir/JPEGs && ls ${archive_dir}_*[0-9].jpg)
37
38 echo " Appending/Copying Images"
39 for image in $images ; do
40 page_num_with_ext=${image#_}
41 #page_num=${page_num_with_ext%.tif}
42 page_num=${page_num_with_ext%.jpg}
43
44 #echo " $full_archive_dir/TIFFs/$image -> $full_item_dir/TIFFs/$image"
45 #/bin/cp $full_archive_dir/TIFFs/$image $full_item_dir/TIFFs/$image
46 echo " $full_archive_dir/JPEGs/$image -> $full_item_dir/JPEGs/$image"
47 /bin/cp $full_archive_dir/JPEGs/$image $full_item_dir/JPEGs/$image
48
49 # Only image, no ocr'd txt file
50 #echo "$page_num:TIFFs/$image:" >> $full_item_filename
51 echo "$page_num:JPEGs/$image:" >> $full_item_filename
52 done
53
54
55
56done
57
58echo ""
59
60
Note: See TracBrowser for help on using the repository browser.