forked from iDigBio/TcnImageTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTcnImageConfig.php
More file actions
123 lines (116 loc) · 7.19 KB
/
TcnImageConfig.php
File metadata and controls
123 lines (116 loc) · 7.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
//Variables needing security
//Base folder containing herbarium folder ; read access needed
$sourcePathBase = '';
//Folder where images are to be placed; write access needed
$targetPathBase = '';
//Url base needed to build image URL that will be save in DB
$imgUrlBase = 'http://storage.idigbio.org/';
//Path to where log files will be placed
$logPath = $sourcePathBase;
//Full path to Symbiota project root folder
$serverRoot = '/var/www/html/symbiota';
// Path to Symbiota Class Files, set to null if class files are
// not available. Correct path is required for the processing of
// xml batch files.
// $symbiotaClassPath = $serverRoot."/classes/";
$symbiotaClassPath = null;
//If silent is set, script will produce not produce a log file.
$silent = 0;
//If record matching PK is not found, should a new blank record be created?
$createNewRec = 1;
//Weather to copyover images with matching names (includes path) or rename new image and keep both
$copyOverImg = 1;
$webPixWidth = 800;
$tnPixWidth = 130;
$lgPixWidth = 2000;
//Whether to use ImageMagick for creating thumbnails and web images. ImageMagick must be installed on server.
// 0 = use GD library (default), 1 = use ImageMagick
$useImageMagick = 0;
//Value between 0 and 100
$jpgCompression = 80;
//Create thumbnail versions of image
$createTnImg = 1;
//Create large version of image, given source image is large enough
$createLgImg = 1;
$keepOrig = 1;
//0 = write image metadata to file; 1 = write metadata to Symbiota database
$dbMetadata = 1;
/**
* Array of parameters for collections to process.
* 'collection:project' => array(
* 'pmterm' => '/A(\d{8})\D+/', // regular expression to match collectionCode and catalogNumber in filename, first backreference is used as the catalogNumber.
* 'collid' => 0, // symbiota collid corresponding with the pterm pattern.
* 'prpatt' => '/^/', // optional regular expression for match on catalogNumber to be replaced with prrepl.
* 'prrepl' => 'barcode-' // optional replacement to apply for prpatt matches on catalogNumber.
* // given above description, 'A01234567.jpg' will yield catalogNumber = 'barcode-01234567'
* )
*
*/
$collArr = array(
'asu:lichens' => array('pmterm' => '/^(ASU\d{7})\D*/', 'collid' => 7)
,'brit:bryophytes' => array('pmterm' => '/^(BRIT\d{5})\D*/', 'collid' => 43)
,'bry:bryophytes' => array('pmterm' => '/^(BRY-B-\d{7})\D*/', 'collid' => 38)
,'bry:lichens' => array('pmterm' => '/^(BRY-L-\d{7})\D*/', 'collid' => 13)
,'chrb:bryophytes' => array('pmterm' => '/^(CHRB-B-\d{7})\D*/', 'collid' => 32)
,'chrb:lichens' => array('pmterm' => '/^(CHRB-L-\d{7})\D*/', 'collid' => 47)
,'colo:bryophytes' => array('pmterm' => '/^(COLO-B-\d{7})\D*/', 'collid' => 23)
,'colo:lichens' => array('pmterm' => '/^(COLO-L-\d{7})\D*/', 'collid' => 41)
,'conn:bryophytes' => array('pmterm' => '/^(CONN\d{8})\D*/', 'collid' => 30)
,'conn:lichens' => array('pmterm' => '/^(CONN\d{8})\D*/', 'collid' => 49)
,'dbg:mycology' => array('pmterm' => '/^(DBG-F-\d{6})\D*/', 'collid' => 1)
,'duke:bryophytes' => array('pmterm' => '/^(\d{7})\D*/', 'collid' => 6)
,'duke:lichens' => array('pmterm' => '/^(\d{7})\D*/', 'collid' => 28)
,'duke:mycology' => array('pmterm' => '/^DUKE-F-(\d{7})\D*/', 'collid' => 25)
,'f:bryophytes' => array('pmterm' => '/^(C\d{7}F)\D*/', 'collid' => 1)
,'fh:bryophytes' => array('pmterm' => '/^FH(\d{8})\D*/', 'collid' => 22, 'prpatt' => '/^/', 'prrepl' => 'barcode-')
,'fh:lichens' => array('pmterm' => '/^FH(\d{8})\D*/', 'collid' => 40, 'prpatt' => '/^/', 'prrepl' => 'barcode-')
,'fh:mycology' => array('pmterm' => '/^FH(\d{8})\D*/', 'collid' => 22, 'prpatt' => '/^/', 'prrepl' => 'barcode-')
,'flas:bryophytes' => array('pmterm' => '/^(FLAS\s{1}B\d{1,7})\D*/', 'collid' => 14)
,'flas:lichens' => array('pmterm' => '/^(FLAS\s{1}L\d{1,7})\D*/', 'collid' => 35)
,'flas:mycology' => array('pmterm' => '/^(FLAS-F-\d{5})\D*/', 'collid' => 13)
,'ill:bryophytes' => array('pmterm' => '/^(ILL\d{8})\D*/', 'collid' => 20)
,'lsu:bryophytes' => array('pmterm' => '/^(LSU\d{8})\D*/', 'collid' => 18)
,'lsu:lichens' => array('pmterm' => '/^(LSU\d{8})\D*/', 'collid' => 37)
,'lsu:mycology' => array('pmterm' => '/^(LSU\d{8})\D*/', 'collid' => 15)
,'mich:bryophytes' => array('pmterm' => '/^(\d{1,7})\D*/', 'collid' => 7)
,'mich:lichens' => array('pmterm' => '/^(\d{1,7})\D*/', 'collid' => 32)
,'mich:mycology' => array('pmterm' => '/^MICH-F-(\d{1,7}[A-Z]{0,1})\D*/', 'collid' => 10)
,'mo:bryophytes' => array('pmterm' => '/^(MO-\d{7})/', 'collid' => 4)
,'mont:lichens' => array('pmterm' => '/^(MONT-L-\d{7})\D*/', 'collid' => 42)
,'montu:mycology' => array('pmterm' => '/^(MONTU-F-\d{6})\D*/', 'collid' => 28)
,'mor:lichens' => array('pmterm' => '/^(L-\d{7}-MOR)/', 'collid' => 48)
,'msc:bryophytes' => array('pmterm' => '/^(MSC\D{0,3}\d{7})\D*/', 'collid' => 16)
,'ncu:bryophytes' => array('pmterm' => '/^(NCU-B-\d{7})\D*/', 'collid' => 26)
,'ncu:mycology' => array('pmterm' => '/^(NCU-F-\d{7})\D*/', 'collid' => 14)
,'neb:bryophytes' => array('pmterm' => '/(NEB\d{8})\D*/', 'collid' => 34)
,'neb:lichens' => array('pmterm' => '/(NEB\d{8})\D*/', 'collid' => 52)
,'nebk:bryophytes' => array('pmterm' => '/(NEBK\d{8})\D*/', 'collid' => 31)
,'nebk:lichens' => array('pmterm' => '/(NEBK\d{8})\D*/', 'collid' => 50)
,'nha:bryophytes' => array('pmterm' => '/^(NHA-\d{6,7})\D*/', 'collid' => 28)
,'nha:lichens' => array('pmterm' => '/^(NHA-\d{6,7})\D*/', 'collid' => 45)
,'ny:lichens' => array('pmterm' => '/0*([1-9]{1}\d{0,7})\D*/', 'collid' => 2)
,'ny:bryophytes' => array('pmterm' => '/0*([1-9]{1}\d{0,7})\D*/', 'collid' => 3)
,'ny:mycology' => array('pmterm' => '/^NY-F-(\d{8})\D*/', 'collid' => 3)
,'os:bryophytes' => array('pmterm' => '/^OS\d{7}\D*/', 'collid' => 19)
,'os:lichens' => array('pmterm' => '/^OS\d{7}\D*/', 'collid' => 38)
,'sfsu:mycology' => array('pmterm' => '/^(SFSU-F-\d{6}[A-Z]{0,1})\D*/', 'collid' => 18)
,'srp:bryophytes' => array('pmterm' => '/^(SRP-B-\d{7})\D*/', 'collid' => 35)
,'srp:lichens' => array('pmterm' => '/^(SRP-L-\d{7})\D*/', 'collid' => 23)
,'tenn:bryophytes' => array('pmterm' => '/^(TENN-B-\d{7})\D*/', 'collid' => 15)
,'tenn:lichens' => array('pmterm' => '/^(TENN-L-\d{7})\D*/', 'collid' => 31)
,'tenn:mycology' => array('pmterm' => '/^TENN\s*(\d{6}[A-Z]{0,1})\D*/', 'collid' => 7)
,'tle:lichens' => array('pmterm' => '/^(d{7})\D*/', 'collid' => 59)
,'ttu:scan' => array('pmterm' => '/^(TTU-Z_\d{6})\D*/', 'collid' => 7)
,'uaic:scan' => array('pmterm' => '/^(UAIC\d{7})\D*/', 'collid' => 11)
,'uc:lichens' => array('pmterm' => '/^(UC\d{5,7})\D*/', 'collid' => 36)
,'uc:mycology' => array('pmterm' => '/^(UC\d{5,7})\D*/', 'collid' => 17)
,'vsc:bryophytes' => array('pmterm' => '/(VSC-L\d{5})\D*/', 'collid' => 13)
,'vt:bryophytes' => array('pmterm' => '/(UVMVT\d{4,6})\D*/i', 'collid' => 9)
,'vt:lichens' => array('pmterm' => '/(UVMVT\d{6})\D*/i', 'collid' => 39)
,'wis:bryophytes' => array('pmterm' => '/^(WIS-B-\d{7})\D*/', 'collid' => 44)
,'wis:lichens' => array('pmterm' => '/^(WIS-L-\d{7})\D*/', 'collid' => 22)
,'wtu:bryophytes' => array('pmterm' => '/^(WTU-B-\d{6})\D*/', 'collid' => 8)
,'wtu:lichens' => array('pmterm' => '/^(WTU-L-\d{6})\D*/', 'collid' => 21)
,'wtu:mycology' => array('pmterm' => '/^(WTU-F-\d{6}[A-Z]{0,1})\D*/', 'collid' => 9)
);