Subversion Repositories eFlore/Applications.cel

Rev

Rev 1200 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1149 gduche 1
<?php
1198 jpm 2
// declare(encoding='UTF-8');
3
/**
4
 * Script de migration des Images de la version 1 de la base de données du CEL à la v2.
1224 jpm 5
 * Utilisation : /opt/lampp/bin/php cli.php MigrationImages
1198 jpm 6
 *
7
 * @category	php 5.2
8
 * @package		Cel/Scripts
1224 jpm 9
 * @author		Aurelien PERONNET <aurelien@tela-botanica.org>
1198 jpm 10
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
11
 * @copyright	Copyright (c) 2012, Tela Botanica (accueil@tela-botanica.org)
1224 jpm 12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
13
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
14
 * @version		$Id$
1198 jpm 15
 */
1224 jpm 16
class MigrationImages {
1189 jpm 17
 
1198 jpm 18
	const dry_run = false;
1160 aurelien 19
	const truncate = true; //Doit on vider les tables de destination ?
1149 gduche 20
	const separateur_champs_metadonnees = ';';
21
	const separateur_valeurs_metadonnees = ':';
1189 jpm 22
 
1224 jpm 23
	private $bdd = null;
24
	private $script = null;
1198 jpm 25
	public static $bdd_cel_migration;
26
	public static $bdd_utilisateurs;
27
	private $cle_id_metadonnees = array();
28
	private $tableau_utilisateurs = array();
29
	private $tableau_observations = array();
30
	private $tableau_mots_cles = array();
1189 jpm 31
 
1149 gduche 32
	/** Tableau associatif permettant de stocker l'avancement dans une boucle.
33
	* La clé est un md5 du message à afficher au démarrage de la boucle.
34
	* @var array
35
	*/
36
	private static $avancement = array();
1189 jpm 37
 
38
	private $tableau_nouveau_ancien = array(
1149 gduche 39
		'id_image' => 'ci_id_image',
40
		'ordre' =>'ci_ordre',
41
		'ce_utilisateur' => 'traiterIdentifiantUtilisateur',
42
		'prenom_utilisateur' => 'traiterPrenomUtilisateur',
43
		'nom_utilisateur' => 'traiterNomUtilisateur',
44
		'courriel_utilisateur' => 'ci_ce_utilisateur',
45
		'hauteur' => 'ci_meta_height',
46
		'largeur' => 'ci_meta_width',
47
		'appareil_fabriquant' => 'ci_meta_make',
48
		'appareil_modele' => 'ci_meta_model',
49
		'date_prise_de_vue' => 'ci_meta_date_time',
1198 jpm 50
		'note_qualite' => 'traiterNoteImage',
51
		'mots_cles_texte' => 'ci_meta_mots_cles',
1149 gduche 52
		'commentaire' => 'ci_meta_comment',
53
		'nom_original' => 'ci_nom_original',
54
		'md5' => 'ci_md5',
55
		'meta_exif' => 'traiterExif',
56
		'meta_iptc' => 'traiterIptc',
57
		'meta_xmp' => 'traiterXmp',
58
		'meta_makernote' => 'traiterMakernote',
59
		'date_modification' => 'ci_meta_date',
60
		'date_creation' => 'ci_meta_date_ajout'
61
	);
1189 jpm 62
 
1149 gduche 63
	private $champs_exifs_non_gardes = array(
64
		'ci_meta_x_resolution',
65
		'ci_meta_y_resolution',
66
		'ci_meta_gps',
67
		'ci_meta_user_comment',
68
		'ci_meta_exif_exposure_time',
69
		'ci_meta_exif_f_number',
70
		'ci_meta_exif_exif_version',
71
		'ci_meta_exif_compressed_bits_per_pixel',
72
		'ci_meta_exif_shutter_speed_value',
73
		'ci_meta_exif_aperture_value',
74
		'ci_meta_exif_exposure_bias_value',
75
		'ci_meta_exif_max_aperture_value',
76
		'ci_meta_exif_metering_mode',
77
		'ci_meta_exif_light_source',
78
		'ci_meta_exif_flash',
79
		'ci_meta_exif_focal_length',
80
		'ci_meta_exif_flash_pix_version',
81
		'ci_meta_exif_color_space',
82
		'ci_meta_exif_interoperability_offset',
83
		'ci_meta_exif_focal_plane_x_resolution',
84
		'ci_meta_exif_focal_plane_y_resolution',
85
		'ci_meta_exif_focal_plane_resolution_unit',
86
		'ci_meta_exif_sensing_method',
87
		'ci_meta_exif_file_source',
88
		'ci_meta_exif_custom_rendered',
89
		'ci_meta_exif_exposure_mode',
90
		'ci_meta_exif_white_balance',
91
		'ci_meta_exif_digital_zoom_ratio',
92
		'ci_meta_exif_scene_capture_type',
93
		'ci_meta_exif_gain_control',
94
		'ci_meta_exif_contrast',
95
		'ci_meta_exif_saturation',
96
		'ci_meta_exif_sharpness',
97
		'ci_meta_exif_subject_distance_range'
98
	);
1189 jpm 99
 
1149 gduche 100
	private $champs_iptc_non_gardes = array(
101
		'ci_meta_iptc_category',
102
		'ci_meta_iptc_by_line',
103
		'ci_meta_iptc_by_line_title',
104
		'ci_meta_iptc_city',
105
		'ci_meta_iptc_sub_location',
106
		'ci_meta_iptc_province_state',
107
		'ci_meta_iptc_country_primary_location_code',
108
		'ci_meta_iptc_country_name',
109
		'ci_meta_iptc_headline',
110
		'ci_meta_iptc_credit',
111
		'ci_meta_iptc_copyright_notice',
112
		'ci_meta_iptc_contact'
113
	);
1189 jpm 114
 
1149 gduche 115
	private $champs_divers_non_gardes = array(
116
		'ci_publiable_eflore',
117
		'ci_meta_mots_cles'
118
	);
1189 jpm 119
 
1198 jpm 120
	private $ids_tags_exif = array(
121
		'InteropIndex' => array('id' => '1', 'tag' => 'InteropIndex', 'categorie' => 'InteropIFD'),
122
		'InteropVersion' => array('id' => '2', 'tag' => 'InteropVersion', 'categorie' => 'InteropIFD'),
123
		'ProcessingSoftware' => array('id' => '11', 'tag' => 'ProcessingSoftware', 'categorie' => 'IFD0'),
124
		'SubfileType' => array('id' => '254', 'tag' => 'SubfileType', 'categorie' => 'IFD0'),
125
		'OldSubfileType' => array('id' => '255', 'tag' => 'OldSubfileType', 'categorie' => 'IFD0'),
126
		'ImageWidth' => array('id' => '256', 'tag' => 'ImageWidth', 'categorie' => 'IFD0'),
127
		'ImageLength' => array('id' => '257', 'tag' => 'ImageHeight', 'categorie' => 'IFD0'),
128
		'BitsPerSample' => array('id' => '258', 'tag' => 'BitsPerSample', 'categorie' => 'IFD0'),
129
		'Compression' => array('id' => '259', 'tag' => 'Compression', 'categorie' => 'IFD0'),
130
		'PhotometricInterpretation' => array('id' => '262', 'tag' => 'PhotometricInterpretation', 'categorie' => 'IFD0'),
131
		'Thresholding' => array('id' => '263', 'tag' => 'Thresholding', 'categorie' => 'IFD0'),
132
		'CellWidth' => array('id' => '264', 'tag' => 'CellWidth', 'categorie' => 'IFD0'),
133
		'CellLength' => array('id' => '265', 'tag' => 'CellLength', 'categorie' => 'IFD0'),
134
		'FillOrder' => array('id' => '266', 'tag' => 'FillOrder', 'categorie' => 'IFD0'),
135
		'DocumentName' => array('id' => '269', 'tag' => 'DocumentName', 'categorie' => 'IFD0'),
136
		'ImageDescription' => array('id' => '270', 'tag' => 'ImageDescription', 'categorie' => 'IFD0'),
137
		'Make' => array('id' => '271', 'tag' => 'Make', 'categorie' => 'IFD0'),
138
		'Model' => array('id' => '272', 'tag' => 'Model', 'categorie' => 'IFD0'),
139
		'StripOffsets' => array('id' => '273', 'tag' => 'StripOffsets', 'categorie' => 'IFD0'),
140
		'Orientation' => array('id' => '274', 'tag' => 'Orientation', 'categorie' => 'IFD0'),
141
		'SamplesPerPixel' => array('id' => '277', 'tag' => 'SamplesPerPixel', 'categorie' => 'IFD0'),
142
		'RowsPerStrip' => array('id' => '278', 'tag' => 'RowsPerStrip', 'categorie' => 'IFD0'),
143
		'StripByteCounts' => array('id' => '279', 'tag' => 'StripByteCounts', 'categorie' => 'IFD0'),
144
		'MinSampleValue' => array('id' => '280', 'tag' => 'MinSampleValue', 'categorie' => 'IFD0'),
145
		'MaxSampleValue' => array('id' => '281', 'tag' => 'MaxSampleValue', 'categorie' => 'IFD0'),
146
		'XResolution' => array('id' => '282', 'tag' => 'XResolution', 'categorie' => 'IFD0'),
147
		'YResolution' => array('id' => '283', 'tag' => 'YResolution', 'categorie' => 'IFD0'),
148
		'PlanarConfiguration' => array('id' => '284', 'tag' => 'PlanarConfiguration', 'categorie' => 'IFD0'),
149
		'PageName' => array('id' => '285', 'tag' => 'PageName', 'categorie' => 'IFD0'),
150
		'XPosition' => array('id' => '286', 'tag' => 'XPosition', 'categorie' => 'IFD0'),
151
		'YPosition' => array('id' => '287', 'tag' => 'YPosition', 'categorie' => 'IFD0'),
152
		'FreeOffsets' => array('id' => '288', 'tag' => 'FreeOffsets', 'categorie' => 'Unknown'),
153
		'FreeByteCounts' => array('id' => '289', 'tag' => 'FreeByteCounts', 'categorie' => 'Unknown'),
154
		'GrayResponseUnit' => array('id' => '290', 'tag' => 'GrayResponseUnit', 'categorie' => 'IFD0'),
155
		'GrayResponseCurve' => array('id' => '291', 'tag' => 'GrayResponseCurve', 'categorie' => 'Unknown'),
156
		'T4Options' => array('id' => '292', 'tag' => 'T4Options', 'categorie' => 'Unknown'),
157
		'T6Options' => array('id' => '293', 'tag' => 'T6Options', 'categorie' => 'Unknown'),
158
		'ResolutionUnit' => array('id' => '296', 'tag' => 'ResolutionUnit', 'categorie' => 'IFD0'),
159
		'PageNumber' => array('id' => '297', 'tag' => 'PageNumber', 'categorie' => 'IFD0'),
160
		'ColorResponseUnit' => array('id' => '300', 'tag' => 'ColorResponseUnit', 'categorie' => 'Unknown'),
161
		'TransferFunction' => array('id' => '301', 'tag' => 'TransferFunction', 'categorie' => 'IFD0'),
162
		'Software' => array('id' => '305', 'tag' => 'Software', 'categorie' => 'IFD0'),
163
		'ModifyDate' => array('id' => '306', 'tag' => 'ModifyDate', 'categorie' => 'IFD0'),
164
		'DateTime' => array('id' => '306', 'tag' => 'ModifyDate', 'categorie' => 'IFD0'),
165
		'Artist' => array('id' => '315', 'tag' => 'Artist', 'categorie' => 'IFD0'),
166
		'HostComputer' => array('id' => '316', 'tag' => 'HostComputer', 'categorie' => 'IFD0'),
167
		'Predictor' => array('id' => '317', 'tag' => 'Predictor', 'categorie' => 'IFD0'),
168
		'WhitePoint' => array('id' => '318', 'tag' => 'WhitePoint', 'categorie' => 'IFD0'),
169
		'PrimaryChromaticities' => array('id' => '319', 'tag' => 'PrimaryChromaticities', 'categorie' => 'IFD0'),
170
		'ColorMap' => array('id' => '320', 'tag' => 'ColorMap', 'categorie' => 'Unknown'),
171
		'HalftoneHints' => array('id' => '321', 'tag' => 'HalftoneHints', 'categorie' => 'IFD0'),
172
		'TileWidth' => array('id' => '322', 'tag' => 'TileWidth', 'categorie' => 'IFD0'),
173
		'TileLength' => array('id' => '323', 'tag' => 'TileLength', 'categorie' => 'IFD0'),
174
		'TileOffsets' => array('id' => '324', 'tag' => 'TileOffsets', 'categorie' => 'Unknown'),
175
		'TileByteCounts' => array('id' => '325', 'tag' => 'TileByteCounts', 'categorie' => 'Unknown'),
176
		'BadFaxLines' => array('id' => '326', 'tag' => 'BadFaxLines', 'categorie' => 'Unknown'),
177
		'CleanFaxData' => array('id' => '327', 'tag' => 'CleanFaxData', 'categorie' => 'Unknown'),
178
		'ConsecutiveBadFaxLines' => array('id' => '328', 'tag' => 'ConsecutiveBadFaxLines', 'categorie' => 'Unknown'),
179
		'SubIFD' => array('id' => '330', 'tag' => 'SubIFD', 'categorie' => 'Unknown'),
180
		'InkSet' => array('id' => '332', 'tag' => 'InkSet', 'categorie' => 'IFD0'),
181
		'InkNames' => array('id' => '333', 'tag' => 'InkNames', 'categorie' => 'Unknown'),
182
		'NumberofInks' => array('id' => '334', 'tag' => 'NumberofInks', 'categorie' => 'Unknown'),
183
		'DotRange' => array('id' => '336', 'tag' => 'DotRange', 'categorie' => 'IFD0'),
184
		'TargetPrinter' => array('id' => '337', 'tag' => 'TargetPrinter', 'categorie' => 'Unknown'),
185
		'ExtraSamples' => array('id' => '338', 'tag' => 'ExtraSamples', 'categorie' => 'Unknown'),
186
		'SampleFormat' => array('id' => '339', 'tag' => 'SampleFormat', 'categorie' => 'Unknown'),
187
		'SMinSampleValue' => array('id' => '340', 'tag' => 'SMinSampleValue', 'categorie' => 'Unknown'),
188
		'SMaxSampleValue' => array('id' => '341', 'tag' => 'SMaxSampleValue', 'categorie' => 'Unknown'),
189
		'TransferRange' => array('id' => '342', 'tag' => 'TransferRange', 'categorie' => 'Unknown'),
190
		'ClipPath' => array('id' => '343', 'tag' => 'ClipPath', 'categorie' => 'Unknown'),
191
		'XClipPathUnits' => array('id' => '344', 'tag' => 'XClipPathUnits', 'categorie' => 'Unknown'),
192
		'YClipPathUnits' => array('id' => '345', 'tag' => 'YClipPathUnits', 'categorie' => 'Unknown'),
193
		'Indexed' => array('id' => '346', 'tag' => 'Indexed', 'categorie' => 'Unknown'),
194
		'JPEGTables' => array('id' => '347', 'tag' => 'JPEGTables', 'categorie' => 'Unknown'),
195
		'OPIProxy' => array('id' => '351', 'tag' => 'OPIProxy', 'categorie' => 'Unknown'),
196
		'GlobalParametersIFD' => array('id' => '400', 'tag' => 'GlobalParametersIFD', 'categorie' => 'Unknown'),
197
		'ProfileType' => array('id' => '401', 'tag' => 'ProfileType', 'categorie' => 'Unknown'),
198
		'FaxProfile' => array('id' => '402', 'tag' => 'FaxProfile', 'categorie' => 'Unknown'),
199
		'CodingMethods' => array('id' => '403', 'tag' => 'CodingMethods', 'categorie' => 'Unknown'),
200
		'VersionYear' => array('id' => '404', 'tag' => 'VersionYear', 'categorie' => 'Unknown'),
201
		'ModeNumber' => array('id' => '405', 'tag' => 'ModeNumber', 'categorie' => 'Unknown'),
202
		'Decode' => array('id' => '433', 'tag' => 'Decode', 'categorie' => 'Unknown'),
203
		'DefaultImageColor' => array('id' => '434', 'tag' => 'DefaultImageColor', 'categorie' => 'Unknown'),
204
		'T82Options' => array('id' => '435', 'tag' => 'T82Options', 'categorie' => 'Unknown'),
205
		'JPEGProc' => array('id' => '512', 'tag' => 'JPEGProc', 'categorie' => 'Unknown'),
206
		'ThumbnailOffset' => array('id' => '513', 'tag' => 'ThumbnailOffset', 'categorie' => 'IFD1'),
207
		'ThumbnailLength' => array('id' => '514', 'tag' => 'ThumbnailLength', 'categorie' => 'IFD1'),
208
		'JPEGRestartInterval' => array('id' => '515', 'tag' => 'JPEGRestartInterval', 'categorie' => 'Unknown'),
209
		'JPEGLosslessPredictors' => array('id' => '517', 'tag' => 'JPEGLosslessPredictors', 'categorie' => 'Unknown'),
210
		'JPEGPointTransforms' => array('id' => '518', 'tag' => 'JPEGPointTransforms', 'categorie' => 'Unknown'),
211
		'JPEGQTables' => array('id' => '519', 'tag' => 'JPEGQTables', 'categorie' => 'Unknown'),
212
		'JPEGDCTables' => array('id' => '520', 'tag' => 'JPEGDCTables', 'categorie' => 'Unknown'),
213
		'JPEGACTables' => array('id' => '521', 'tag' => 'JPEGACTables', 'categorie' => 'Unknown'),
214
		'YCbCrCoefficients' => array('id' => '529', 'tag' => 'YCbCrCoefficients', 'categorie' => 'IFD0'),
215
		'YCbCrSubSampling' => array('id' => '530', 'tag' => 'YCbCrSubSampling', 'categorie' => 'IFD0'),
216
		'YCbCrPositioning' => array('id' => '531', 'tag' => 'YCbCrPositioning', 'categorie' => 'IFD0'),
217
		'ReferenceBlackWhite' => array('id' => '532', 'tag' => 'ReferenceBlackWhite', 'categorie' => 'IFD0'),
218
		'StripRowCounts' => array('id' => '559', 'tag' => 'StripRowCounts', 'categorie' => 'Unknown'),
219
		'ApplicationNotes' => array('id' => '700', 'tag' => 'ApplicationNotes', 'categorie' => 'ExifIFD'),
220
		'USPTOMiscellaneous' => array('id' => '999', 'tag' => 'USPTOMiscellaneous', 'categorie' => 'Unknown'),
221
		'RelatedImageFileFormat' => array('id' => '4096', 'tag' => 'RelatedImageFileFormat', 'categorie' => 'InteropIFD'),
222
		'RelatedImageWidth' => array('id' => '4097', 'tag' => 'RelatedImageWidth', 'categorie' => 'InteropIFD'),
223
		'RelatedImageHeight' => array('id' => '4098', 'tag' => 'RelatedImageHeight', 'categorie' => 'InteropIFD'),
224
		'RelatedImageLength' => array('id' => '4098', 'tag' => 'RelatedImageHeight', 'categorie' => 'InteropIFD'),
225
		'Rating' => array('id' => '18246', 'tag' => 'Rating', 'categorie' => 'IFD0'),
226
		'XP_DIP_XML' => array('id' => '18247', 'tag' => 'XP_DIP_XML', 'categorie' => 'Unknown'),
227
		'StitchInfo' => array('id' => '18248', 'tag' => 'StitchInfo', 'categorie' => 'Unknown'),
228
		'RatingPercent' => array('id' => '18249', 'tag' => 'RatingPercent', 'categorie' => 'IFD0'),
229
		'ImageID' => array('id' => '32781', 'tag' => 'ImageID', 'categorie' => 'Unknown'),
230
		'WangTag1' => array('id' => '32931', 'tag' => 'WangTag1', 'categorie' => 'Unknown'),
231
		'WangAnnotation' => array('id' => '32932', 'tag' => 'WangAnnotation', 'categorie' => 'Unknown'),
232
		'WangTag3' => array('id' => '32933', 'tag' => 'WangTag3', 'categorie' => 'Unknown'),
233
		'WangTag4' => array('id' => '32934', 'tag' => 'WangTag4', 'categorie' => 'Unknown'),
234
		'Matteing' => array('id' => '32995', 'tag' => 'Matteing', 'categorie' => 'Unknown'),
235
		'DataType' => array('id' => '32996', 'tag' => 'DataType', 'categorie' => 'Unknown'),
236
		'ImageDepth' => array('id' => '32997', 'tag' => 'ImageDepth', 'categorie' => 'Unknown'),
237
		'TileDepth' => array('id' => '32998', 'tag' => 'TileDepth', 'categorie' => 'Unknown'),
238
		'Model2' => array('id' => '33405', 'tag' => 'Model2', 'categorie' => 'Unknown'),
239
		'CFARepeatPatternDim' => array('id' => '33421', 'tag' => 'CFARepeatPatternDim', 'categorie' => 'Unknown'),
240
		'CFAPattern2' => array('id' => '33422', 'tag' => 'CFAPattern2', 'categorie' => 'Unknown'),
241
		'BatteryLevel' => array('id' => '33423', 'tag' => 'BatteryLevel', 'categorie' => 'Unknown'),
242
		'KodakIFD' => array('id' => '33424', 'tag' => 'KodakIFD', 'categorie' => 'Unknown'),
243
		'Copyright' => array('id' => '33432', 'tag' => 'Copyright', 'categorie' => 'IFD0'),
244
		'ExposureTime' => array('id' => '33434', 'tag' => 'ExposureTime', 'categorie' => 'ExifIFD'),
245
		'FNumber' => array('id' => '33437', 'tag' => 'FNumber', 'categorie' => 'ExifIFD'),
246
		'MDFileTag' => array('id' => '33445', 'tag' => 'MDFileTag', 'categorie' => 'Unknown'),
247
		'MDScalePixel' => array('id' => '33446', 'tag' => 'MDScalePixel', 'categorie' => 'Unknown'),
248
		'MDColorTable' => array('id' => '33447', 'tag' => 'MDColorTable', 'categorie' => 'Unknown'),
249
		'MDLabName' => array('id' => '33448', 'tag' => 'MDLabName', 'categorie' => 'Unknown'),
250
		'MDSampleInfo' => array('id' => '33449', 'tag' => 'MDSampleInfo', 'categorie' => 'Unknown'),
251
		'MDPrepDate' => array('id' => '33450', 'tag' => 'MDPrepDate', 'categorie' => 'Unknown'),
252
		'MDPrepTime' => array('id' => '33451', 'tag' => 'MDPrepTime', 'categorie' => 'Unknown'),
253
		'MDFileUnits' => array('id' => '33452', 'tag' => 'MDFileUnits', 'categorie' => 'Unknown'),
254
		'PixelScale' => array('id' => '33550', 'tag' => 'PixelScale', 'categorie' => 'Unknown'),
255
		'AdventScale' => array('id' => '33589', 'tag' => 'AdventScale', 'categorie' => 'Unknown'),
256
		'AdventRevision' => array('id' => '33590', 'tag' => 'AdventRevision', 'categorie' => 'Unknown'),
257
		'UIC1Tag' => array('id' => '33628', 'tag' => 'UIC1Tag', 'categorie' => 'Unknown'),
258
		'UIC2Tag' => array('id' => '33629', 'tag' => 'UIC2Tag', 'categorie' => 'Unknown'),
259
		'UIC3Tag' => array('id' => '33630', 'tag' => 'UIC3Tag', 'categorie' => 'Unknown'),
260
		'UIC4Tag' => array('id' => '33631', 'tag' => 'UIC4Tag', 'categorie' => 'Unknown'),
261
		'IPTC-NAA' => array('id' => '33723', 'tag' => 'IPTC-NAA', 'categorie' => 'IFD0'),
262
		'IntergraphPacketData' => array('id' => '33918', 'tag' => 'IntergraphPacketData', 'categorie' => 'Unknown'),
263
		'IntergraphFlagRegisters' => array('id' => '33919', 'tag' => 'IntergraphFlagRegisters', 'categorie' => 'Unknown'),
264
		'IntergraphMatrix' => array('id' => '33920', 'tag' => 'IntergraphMatrix', 'categorie' => 'Unknown'),
265
		'INGRReserved' => array('id' => '33921', 'tag' => 'INGRReserved', 'categorie' => 'Unknown'),
266
		'ModelTiePoint' => array('id' => '33922', 'tag' => 'ModelTiePoint', 'categorie' => 'Unknown'),
267
		'Site' => array('id' => '34016', 'tag' => 'Site', 'categorie' => 'Unknown'),
268
		'ColorSequence' => array('id' => '34017', 'tag' => 'ColorSequence', 'categorie' => 'Unknown'),
269
		'IT8Header' => array('id' => '34018', 'tag' => 'IT8Header', 'categorie' => 'Unknown'),
270
		'RasterPadding' => array('id' => '34019', 'tag' => 'RasterPadding', 'categorie' => 'Unknown'),
271
		'BitsPerRunLength' => array('id' => '34020', 'tag' => 'BitsPerRunLength', 'categorie' => 'Unknown'),
272
		'BitsPerExtendedRunLength' => array('id' => '34021', 'tag' => 'BitsPerExtendedRunLength', 'categorie' => 'Unknown'),
273
		'ColorTable' => array('id' => '34022', 'tag' => 'ColorTable', 'categorie' => 'Unknown'),
274
		'ImageColorIndicator' => array('id' => '34023', 'tag' => 'ImageColorIndicator', 'categorie' => 'Unknown'),
275
		'BackgroundColorIndicator' => array('id' => '34024', 'tag' => 'BackgroundColorIndicator', 'categorie' => 'Unknown'),
276
		'ImageColorValue' => array('id' => '34025', 'tag' => 'ImageColorValue', 'categorie' => 'Unknown'),
277
		'BackgroundColorValue' => array('id' => '34026', 'tag' => 'BackgroundColorValue', 'categorie' => 'Unknown'),
278
		'PixelIntensityRange' => array('id' => '34027', 'tag' => 'PixelIntensityRange', 'categorie' => 'Unknown'),
279
		'TransparencyIndicator' => array('id' => '34028', 'tag' => 'TransparencyIndicator', 'categorie' => 'Unknown'),
280
		'ColorCharacterization' => array('id' => '34029', 'tag' => 'ColorCharacterization', 'categorie' => 'Unknown'),
281
		'HCUsage' => array('id' => '34030', 'tag' => 'HCUsage', 'categorie' => 'Unknown'),
282
		'TrapIndicator' => array('id' => '34031', 'tag' => 'TrapIndicator', 'categorie' => 'Unknown'),
283
		'CMYKEquivalent' => array('id' => '34032', 'tag' => 'CMYKEquivalent', 'categorie' => 'Unknown'),
284
		'SEMInfo' => array('id' => '34118', 'tag' => 'SEMInfo', 'categorie' => 'IFD0'),
285
		'AFCP_IPTC' => array('id' => '34152', 'tag' => 'AFCP_IPTC', 'categorie' => 'Unknown'),
286
		'PixelMagicJBIGOptions' => array('id' => '34232', 'tag' => 'PixelMagicJBIGOptions', 'categorie' => 'Unknown'),
287
		'ModelTransform' => array('id' => '34264', 'tag' => 'ModelTransform', 'categorie' => 'Unknown'),
288
		'WB_GRGBLevels' => array('id' => '34306', 'tag' => 'WB_GRGBLevels', 'categorie' => 'Unknown'),
289
		'LeafData' => array('id' => '34310', 'tag' => 'LeafData', 'categorie' => 'Unknown'),
290
		'PhotoshopSettings' => array('id' => '34377', 'tag' => 'PhotoshopSettings', 'categorie' => 'Unknown'),
291
		'ExifIFDPointer' => array('id' => '34665', 'tag' => 'ExifOffset', 'categorie' => 'Unknown'),
292
		'ICC_Profile' => array('id' => '34675', 'tag' => 'ICC_Profile', 'categorie' => 'Unknown'),
293
		'TIFF_FXExtensions' => array('id' => '34687', 'tag' => 'TIFF_FXExtensions', 'categorie' => 'Unknown'),
294
		'MultiProfiles' => array('id' => '34688', 'tag' => 'MultiProfiles', 'categorie' => 'Unknown'),
295
		'SharedData' => array('id' => '34689', 'tag' => 'SharedData', 'categorie' => 'Unknown'),
296
		'T88Options' => array('id' => '34690', 'tag' => 'T88Options', 'categorie' => 'Unknown'),
297
		'ImageLayer' => array('id' => '34732', 'tag' => 'ImageLayer', 'categorie' => 'Unknown'),
298
		'GeoTiffDirectory' => array('id' => '34735', 'tag' => 'GeoTiffDirectory', 'categorie' => 'Unknown'),
299
		'GeoTiffDoubleParams' => array('id' => '34736', 'tag' => 'GeoTiffDoubleParams', 'categorie' => 'Unknown'),
300
		'GeoTiffAsciiParams' => array('id' => '34737', 'tag' => 'GeoTiffAsciiParams', 'categorie' => 'Unknown'),
301
		'ExposureProgram' => array('id' => '34850', 'tag' => 'ExposureProgram', 'categorie' => 'ExifIFD'),
302
		'SpectralSensitivity' => array('id' => '34852', 'tag' => 'SpectralSensitivity', 'categorie' => 'ExifIFD'),
303
		'GPSIFDPointer' => array('id' => '34853', 'tag' => 'GPSInfo', 'categorie' => 'Unknown'),
304
		'ISO' => array('id' => '34855', 'tag' => 'ISO', 'categorie' => 'ExifIFD'),
305
		'ISOSpeedRatings' => array('id' => '34855', 'tag' => 'ISO', 'categorie' => 'ExifIFD'),
306
		'PhotographicSensitivity' => array('id' => '34855', 'tag' => 'ISO', 'categorie' => 'ExifIFD'),
307
		'Opto-ElectricConvFactor' => array('id' => '34856', 'tag' => 'Opto-ElectricConvFactor', 'categorie' => 'Unknown'),
308
		'OECF' => array('id' => '34856', 'tag' => 'Opto-ElectricConvFactor', 'categorie' => 'Unknown'),
309
		'Interlace' => array('id' => '34857', 'tag' => 'Interlace', 'categorie' => 'Unknown'),
310
		'TimeZoneOffset' => array('id' => '34858', 'tag' => 'TimeZoneOffset', 'categorie' => 'ExifIFD'),
311
		'SelfTimerMode' => array('id' => '34859', 'tag' => 'SelfTimerMode', 'categorie' => 'ExifIFD'),
312
		'SensitivityType' => array('id' => '34864', 'tag' => 'SensitivityType', 'categorie' => 'ExifIFD'),
313
		'StandardOutputSensitivity' => array('id' => '34865', 'tag' => 'StandardOutputSensitivity', 'categorie' => 'ExifIFD'),
314
		'RecommendedExposureIndex' => array('id' => '34866', 'tag' => 'RecommendedExposureIndex', 'categorie' => 'ExifIFD'),
315
		'ISOSpeed' => array('id' => '34867', 'tag' => 'ISOSpeed', 'categorie' => 'ExifIFD'),
316
		'ISOSpeedLatitudeyyy' => array('id' => '34868', 'tag' => 'ISOSpeedLatitudeyyy', 'categorie' => 'ExifIFD'),
317
		'ISOSpeedLatitudezzz' => array('id' => '34869', 'tag' => 'ISOSpeedLatitudezzz', 'categorie' => 'ExifIFD'),
318
		'FaxRecvParams' => array('id' => '34908', 'tag' => 'FaxRecvParams', 'categorie' => 'Unknown'),
319
		'FaxSubAddress' => array('id' => '34909', 'tag' => 'FaxSubAddress', 'categorie' => 'Unknown'),
320
		'FaxRecvTime' => array('id' => '34910', 'tag' => 'FaxRecvTime', 'categorie' => 'Unknown'),
321
		'LeafSubIFD' => array('id' => '34954', 'tag' => 'LeafSubIFD', 'categorie' => 'Unknown'),
322
		'ExifVersion' => array('id' => '36864', 'tag' => 'ExifVersion', 'categorie' => 'ExifIFD'),
323
		'DateTimeOriginal' => array('id' => '36867', 'tag' => 'DateTimeOriginal', 'categorie' => 'ExifIFD'),
324
		'CreateDate' => array('id' => '36868', 'tag' => 'CreateDate', 'categorie' => 'ExifIFD'),
325
		'DateTimeDigitized' => array('id' => '36868', 'tag' => 'CreateDate', 'categorie' => 'ExifIFD'),
326
		'ComponentsConfiguration' => array('id' => '37121', 'tag' => 'ComponentsConfiguration', 'categorie' => 'ExifIFD'),
327
		'CompressedBitsPerPixel' => array('id' => '37122', 'tag' => 'CompressedBitsPerPixel', 'categorie' => 'ExifIFD'),
328
		'ShutterSpeedValue' => array('id' => '37377', 'tag' => 'ShutterSpeedValue', 'categorie' => 'ExifIFD'),
329
		'ApertureValue' => array('id' => '37378', 'tag' => 'ApertureValue', 'categorie' => 'ExifIFD'),
330
		'BrightnessValue' => array('id' => '37379', 'tag' => 'BrightnessValue', 'categorie' => 'ExifIFD'),
331
		'ExposureBiasValue' => array('id' => '37380', 'tag' => 'ExposureCompensation', 'categorie' => 'ExifIFD'),
332
		'MaxApertureValue' => array('id' => '37381', 'tag' => 'MaxApertureValue', 'categorie' => 'ExifIFD'),
333
		'SubjectDistance' => array('id' => '37382', 'tag' => 'SubjectDistance', 'categorie' => 'ExifIFD'),
334
		'MeteringMode' => array('id' => '37383', 'tag' => 'MeteringMode', 'categorie' => 'ExifIFD'),
335
		'LightSource' => array('id' => '37384', 'tag' => 'LightSource', 'categorie' => 'ExifIFD'),
336
		'Flash' => array('id' => '37385', 'tag' => 'Flash', 'categorie' => 'ExifIFD'),
337
		'FocalLength' => array('id' => '37386', 'tag' => 'FocalLength', 'categorie' => 'ExifIFD'),
338
		'FlashEnergy' => array('id' => '37387', 'tag' => 'FlashEnergy', 'categorie' => 'Unknown'),
339
		'SpatialFrequencyResponse' => array('id' => '37388', 'tag' => 'SpatialFrequencyResponse', 'categorie' => 'Unknown'),
340
		'Noise' => array('id' => '37389', 'tag' => 'Noise', 'categorie' => 'Unknown'),
341
		'FocalPlaneXResolution' => array('id' => '37390', 'tag' => 'FocalPlaneXResolution', 'categorie' => 'Unknown'),
342
		'FocalPlaneYResolution' => array('id' => '37391', 'tag' => 'FocalPlaneYResolution', 'categorie' => 'Unknown'),
343
		'FocalPlaneResolutionUnit' => array('id' => '37392', 'tag' => 'FocalPlaneResolutionUnit', 'categorie' => 'Unknown'),
344
		'ImageNumber' => array('id' => '37393', 'tag' => 'ImageNumber', 'categorie' => 'ExifIFD'),
345
		'SecurityClassification' => array('id' => '37394', 'tag' => 'SecurityClassification', 'categorie' => 'ExifIFD'),
346
		'ImageHistory' => array('id' => '37395', 'tag' => 'ImageHistory', 'categorie' => 'ExifIFD'),
347
		'SubjectArea' => array('id' => '37396', 'tag' => 'SubjectArea', 'categorie' => 'ExifIFD'),
348
		'ExposureIndex' => array('id' => '37397', 'tag' => 'ExposureIndex', 'categorie' => 'Unknown'),
349
		'TIFF-EPStandardID' => array('id' => '37398', 'tag' => 'TIFF-EPStandardID', 'categorie' => 'Unknown'),
350
		'SensingMethod' => array('id' => '37399', 'tag' => 'SensingMethod', 'categorie' => 'Unknown'),
351
		'CIP3DataFile' => array('id' => '37434', 'tag' => 'CIP3DataFile', 'categorie' => 'Unknown'),
352
		'CIP3Sheet' => array('id' => '37435', 'tag' => 'CIP3Sheet', 'categorie' => 'Unknown'),
353
		'CIP3Side' => array('id' => '37436', 'tag' => 'CIP3Side', 'categorie' => 'Unknown'),
354
		'StoNits' => array('id' => '37439', 'tag' => 'StoNits', 'categorie' => 'Unknown'),
355
		'MakerNote' => array('id' => '37500', 'tag' => 'MakerNote', 'categorie' => 'ExifIFD'),
356
		'UserComment' => array('id' => '37510', 'tag' => 'UserComment', 'categorie' => 'ExifIFD'),
357
		'SubSecTime' => array('id' => '37520', 'tag' => 'SubSecTime', 'categorie' => 'ExifIFD'),
358
		'SubSecTimeOriginal' => array('id' => '37521', 'tag' => 'SubSecTimeOriginal', 'categorie' => 'ExifIFD'),
359
		'SubSecTimeDigitized' => array('id' => '37522', 'tag' => 'SubSecTimeDigitized', 'categorie' => 'ExifIFD'),
360
		'MSDocumentText' => array('id' => '37679', 'tag' => 'MSDocumentText', 'categorie' => 'Unknown'),
361
		'MSPropertySetStorage' => array('id' => '37680', 'tag' => 'MSPropertySetStorage', 'categorie' => 'Unknown'),
362
		'MSDocumentTextPosition' => array('id' => '37681', 'tag' => 'MSDocumentTextPosition', 'categorie' => 'Unknown'),
363
		'ImageSourceData' => array('id' => '37724', 'tag' => 'ImageSourceData', 'categorie' => 'IFD0'),
364
		'XPTitle' => array('id' => '40091', 'tag' => 'XPTitle', 'categorie' => 'IFD0'),
365
		'XPComment' => array('id' => '40092', 'tag' => 'XPComment', 'categorie' => 'IFD0'),
366
		'XPAuthor' => array('id' => '40093', 'tag' => 'XPAuthor', 'categorie' => 'IFD0'),
367
		'XPKeywords' => array('id' => '40094', 'tag' => 'XPKeywords', 'categorie' => 'IFD0'),
368
		'XPSubject' => array('id' => '40095', 'tag' => 'XPSubject', 'categorie' => 'IFD0'),
369
		'FlashPixVersion' => array('id' => '40960', 'tag' => 'FlashpixVersion', 'categorie' => 'ExifIFD'),
370
		'ColorSpace' => array('id' => '40961', 'tag' => 'ColorSpace', 'categorie' => 'ExifIFD'),
371
		'ExifImageWidth' => array('id' => '40962', 'tag' => 'ExifImageWidth', 'categorie' => 'ExifIFD'),
372
		'PixelXDimension' => array('id' => '40962', 'tag' => 'ExifImageWidth', 'categorie' => 'ExifIFD'),
373
		'ExifImageHeight' => array('id' => '40963', 'tag' => 'ExifImageHeight', 'categorie' => 'ExifIFD'),
374
		'PixelYDimension' => array('id' => '40963', 'tag' => 'ExifImageHeight', 'categorie' => 'ExifIFD'),
375
		'RelatedSoundFile' => array('id' => '40964', 'tag' => 'RelatedSoundFile', 'categorie' => 'ExifIFD'),
376
		'InteroperabilityOffset' => array('id' => '40965', 'tag' => 'InteropOffset', 'categorie' => 'Unknown'),
377
		'SubjectLocation' => array('id' => '41492', 'tag' => 'SubjectLocation', 'categorie' => 'ExifIFD'),
378
		'FileSource' => array('id' => '41728', 'tag' => 'FileSource', 'categorie' => 'ExifIFD'),
379
		'SceneType' => array('id' => '41729', 'tag' => 'SceneType', 'categorie' => 'ExifIFD'),
380
		'CFAPattern' => array('id' => '41730', 'tag' => 'CFAPattern', 'categorie' => 'ExifIFD'),
381
		'CustomRendered' => array('id' => '41985', 'tag' => 'CustomRendered', 'categorie' => 'ExifIFD'),
382
		'ExposureMode' => array('id' => '41986', 'tag' => 'ExposureMode', 'categorie' => 'ExifIFD'),
383
		'WhiteBalance' => array('id' => '41987', 'tag' => 'WhiteBalance', 'categorie' => 'ExifIFD'),
384
		'DigitalZoomRatio' => array('id' => '41988', 'tag' => 'DigitalZoomRatio', 'categorie' => 'ExifIFD'),
385
		'FocalLengthIn35mmFormat' => array('id' => '41989', 'tag' => 'FocalLengthIn35mmFormat', 'categorie' => 'ExifIFD'),
386
		'FocalLengthIn35mmFilm' => array('id' => '41989', 'tag' => 'FocalLengthIn35mmFormat', 'categorie' => 'ExifIFD'),
387
		'SceneCaptureType' => array('id' => '41990', 'tag' => 'SceneCaptureType', 'categorie' => 'ExifIFD'),
388
		'GainControl' => array('id' => '41991', 'tag' => 'GainControl', 'categorie' => 'ExifIFD'),
389
		'Contrast' => array('id' => '41992', 'tag' => 'Contrast', 'categorie' => 'ExifIFD'),
390
		'Saturation' => array('id' => '41993', 'tag' => 'Saturation', 'categorie' => 'ExifIFD'),
391
		'Sharpness' => array('id' => '41994', 'tag' => 'Sharpness', 'categorie' => 'ExifIFD'),
392
		'DeviceSettingDescription' => array('id' => '41995', 'tag' => 'DeviceSettingDescription', 'categorie' => 'Unknown'),
393
		'SubjectDistanceRange' => array('id' => '41996', 'tag' => 'SubjectDistanceRange', 'categorie' => 'ExifIFD'),
394
		'ImageUniqueID' => array('id' => '42016', 'tag' => 'ImageUniqueID', 'categorie' => 'ExifIFD'),
395
		'OwnerName' => array('id' => '42032', 'tag' => 'OwnerName', 'categorie' => 'ExifIFD'),
396
		'CameraOwnerName' => array('id' => '42032', 'tag' => 'OwnerName', 'categorie' => 'ExifIFD'),
397
		'SerialNumber' => array('id' => '42033', 'tag' => 'SerialNumber', 'categorie' => 'ExifIFD'),
398
		'BodySerialNumber' => array('id' => '42033', 'tag' => 'SerialNumber', 'categorie' => 'ExifIFD'),
399
		'LensInfo' => array('id' => '42034', 'tag' => 'LensInfo', 'categorie' => 'ExifIFD'),
400
		'LensSpecification' => array('id' => '42034', 'tag' => 'LensInfo', 'categorie' => 'ExifIFD'),
401
		'LensMake' => array('id' => '42035', 'tag' => 'LensMake', 'categorie' => 'ExifIFD'),
402
		'LensModel' => array('id' => '42036', 'tag' => 'LensModel', 'categorie' => 'ExifIFD'),
403
		'LensSerialNumber' => array('id' => '42037', 'tag' => 'LensSerialNumber', 'categorie' => 'ExifIFD'),
404
		'GDALMetadata' => array('id' => '42112', 'tag' => 'GDALMetadata', 'categorie' => 'Unknown'),
405
		'GDALNoData' => array('id' => '42113', 'tag' => 'GDALNoData', 'categorie' => 'Unknown'),
406
		'Gamma' => array('id' => '42240', 'tag' => 'Gamma', 'categorie' => 'ExifIFD'),
407
		'ExpandSoftware' => array('id' => '44992', 'tag' => 'ExpandSoftware', 'categorie' => 'Unknown'),
408
		'ExpandLens' => array('id' => '44993', 'tag' => 'ExpandLens', 'categorie' => 'Unknown'),
409
		'ExpandFilm' => array('id' => '44994', 'tag' => 'ExpandFilm', 'categorie' => 'Unknown'),
410
		'ExpandFilterLens' => array('id' => '44995', 'tag' => 'ExpandFilterLens', 'categorie' => 'Unknown'),
411
		'ExpandScanner' => array('id' => '44996', 'tag' => 'ExpandScanner', 'categorie' => 'Unknown'),
412
		'ExpandFlashLamp' => array('id' => '44997', 'tag' => 'ExpandFlashLamp', 'categorie' => 'Unknown'),
413
		'PixelFormat' => array('id' => '48129', 'tag' => 'PixelFormat', 'categorie' => 'Unknown'),
414
		'Transformation' => array('id' => '48130', 'tag' => 'Transformation', 'categorie' => 'Unknown'),
415
		'Uncompressed' => array('id' => '48131', 'tag' => 'Uncompressed', 'categorie' => 'Unknown'),
416
		'ImageType' => array('id' => '48132', 'tag' => 'ImageType', 'categorie' => 'Unknown'),
417
		'ImageHeight' => array('id' => '48257', 'tag' => 'ImageHeight', 'categorie' => 'Unknown'),
418
		'WidthResolution' => array('id' => '48258', 'tag' => 'WidthResolution', 'categorie' => 'Unknown'),
419
		'HeightResolution' => array('id' => '48259', 'tag' => 'HeightResolution', 'categorie' => 'Unknown'),
420
		'ImageOffset' => array('id' => '48320', 'tag' => 'ImageOffset', 'categorie' => 'Unknown'),
421
		'ImageByteCount' => array('id' => '48321', 'tag' => 'ImageByteCount', 'categorie' => 'Unknown'),
422
		'AlphaOffset' => array('id' => '48322', 'tag' => 'AlphaOffset', 'categorie' => 'Unknown'),
423
		'AlphaByteCount' => array('id' => '48323', 'tag' => 'AlphaByteCount', 'categorie' => 'Unknown'),
424
		'ImageDataDiscard' => array('id' => '48324', 'tag' => 'ImageDataDiscard', 'categorie' => 'Unknown'),
425
		'AlphaDataDiscard' => array('id' => '48325', 'tag' => 'AlphaDataDiscard', 'categorie' => 'Unknown'),
426
		'OceScanjobDesc' => array('id' => '50215', 'tag' => 'OceScanjobDesc', 'categorie' => 'Unknown'),
427
		'OceApplicationSelector' => array('id' => '50216', 'tag' => 'OceApplicationSelector', 'categorie' => 'Unknown'),
428
		'OceIDNumber' => array('id' => '50217', 'tag' => 'OceIDNumber', 'categorie' => 'Unknown'),
429
		'OceImageLogic' => array('id' => '50218', 'tag' => 'OceImageLogic', 'categorie' => 'Unknown'),
430
		'Annotations' => array('id' => '50255', 'tag' => 'Annotations', 'categorie' => 'Unknown'),
431
		'PrintIM' => array('id' => '50341', 'tag' => 'PrintIM', 'categorie' => 'IFD0'),
432
		'USPTOOriginalContentType' => array('id' => '50560', 'tag' => 'USPTOOriginalContentType', 'categorie' => 'Unknown'),
433
		'DNGVersion' => array('id' => '50706', 'tag' => 'DNGVersion', 'categorie' => 'IFD0'),
434
		'DNGBackwardVersion' => array('id' => '50707', 'tag' => 'DNGBackwardVersion', 'categorie' => 'IFD0'),
435
		'UniqueCameraModel' => array('id' => '50708', 'tag' => 'UniqueCameraModel', 'categorie' => 'IFD0'),
436
		'LocalizedCameraModel' => array('id' => '50709', 'tag' => 'LocalizedCameraModel', 'categorie' => 'IFD0'),
437
		'CFAPlaneColor' => array('id' => '50710', 'tag' => 'CFAPlaneColor', 'categorie' => 'Unknown'),
438
		'CFALayout' => array('id' => '50711', 'tag' => 'CFALayout', 'categorie' => 'Unknown'),
439
		'LinearizationTable' => array('id' => '50712', 'tag' => 'LinearizationTable', 'categorie' => 'SubIFD'),
440
		'BlackLevelRepeatDim' => array('id' => '50713', 'tag' => 'BlackLevelRepeatDim', 'categorie' => 'SubIFD'),
441
		'BlackLevel' => array('id' => '50714', 'tag' => 'BlackLevel', 'categorie' => 'SubIFD'),
442
		'BlackLevelDeltaH' => array('id' => '50715', 'tag' => 'BlackLevelDeltaH', 'categorie' => 'Unknown'),
443
		'BlackLevelDeltaV' => array('id' => '50716', 'tag' => 'BlackLevelDeltaV', 'categorie' => 'Unknown'),
444
		'WhiteLevel' => array('id' => '50717', 'tag' => 'WhiteLevel', 'categorie' => 'SubIFD'),
445
		'DefaultScale' => array('id' => '50718', 'tag' => 'DefaultScale', 'categorie' => 'SubIFD'),
446
		'DefaultCropOrigin' => array('id' => '50719', 'tag' => 'DefaultCropOrigin', 'categorie' => 'SubIFD'),
447
		'DefaultCropSize' => array('id' => '50720', 'tag' => 'DefaultCropSize', 'categorie' => 'SubIFD'),
448
		'ColorMatrix1' => array('id' => '50721', 'tag' => 'ColorMatrix1', 'categorie' => 'IFD0'),
449
		'ColorMatrix2' => array('id' => '50722', 'tag' => 'ColorMatrix2', 'categorie' => 'IFD0'),
450
		'CameraCalibration1' => array('id' => '50723', 'tag' => 'CameraCalibration1', 'categorie' => 'IFD0'),
451
		'CameraCalibration2' => array('id' => '50724', 'tag' => 'CameraCalibration2', 'categorie' => 'IFD0'),
452
		'ReductionMatrix1' => array('id' => '50725', 'tag' => 'ReductionMatrix1', 'categorie' => 'IFD0'),
453
		'ReductionMatrix2' => array('id' => '50726', 'tag' => 'ReductionMatrix2', 'categorie' => 'IFD0'),
454
		'AnalogBalance' => array('id' => '50727', 'tag' => 'AnalogBalance', 'categorie' => 'IFD0'),
455
		'AsShotNeutral' => array('id' => '50728', 'tag' => 'AsShotNeutral', 'categorie' => 'IFD0'),
456
		'AsShotWhiteXY' => array('id' => '50729', 'tag' => 'AsShotWhiteXY', 'categorie' => 'IFD0'),
457
		'BaselineExposure' => array('id' => '50730', 'tag' => 'BaselineExposure', 'categorie' => 'IFD0'),
458
		'BaselineNoise' => array('id' => '50731', 'tag' => 'BaselineNoise', 'categorie' => 'IFD0'),
459
		'BaselineSharpness' => array('id' => '50732', 'tag' => 'BaselineSharpness', 'categorie' => 'IFD0'),
460
		'BayerGreenSplit' => array('id' => '50733', 'tag' => 'BayerGreenSplit', 'categorie' => 'SubIFD'),
461
		'LinearResponseLimit' => array('id' => '50734', 'tag' => 'LinearResponseLimit', 'categorie' => 'IFD0'),
462
		'CameraSerialNumber' => array('id' => '50735', 'tag' => 'CameraSerialNumber', 'categorie' => 'IFD0'),
463
		'DNGLensInfo' => array('id' => '50736', 'tag' => 'DNGLensInfo', 'categorie' => 'IFD0'),
464
		'ChromaBlurRadius' => array('id' => '50737', 'tag' => 'ChromaBlurRadius', 'categorie' => 'SubIFD'),
465
		'AntiAliasStrength' => array('id' => '50738', 'tag' => 'AntiAliasStrength', 'categorie' => 'SubIFD'),
466
		'ShadowScale' => array('id' => '50739', 'tag' => 'ShadowScale', 'categorie' => 'IFD0'),
467
		'SR2Private' => array('id' => '50740', 'tag' => 'SR2Private', 'categorie' => 'Unknown'),
468
		'MakerNoteSafety' => array('id' => '50741', 'tag' => 'MakerNoteSafety', 'categorie' => 'IFD0'),
469
		'RawImageSegmentation' => array('id' => '50752', 'tag' => 'RawImageSegmentation', 'categorie' => 'Unknown'),
470
		'CalibrationIlluminant1' => array('id' => '50778', 'tag' => 'CalibrationIlluminant1', 'categorie' => 'IFD0'),
471
		'CalibrationIlluminant2' => array('id' => '50779', 'tag' => 'CalibrationIlluminant2', 'categorie' => 'IFD0'),
472
		'BestQualityScale' => array('id' => '50780', 'tag' => 'BestQualityScale', 'categorie' => 'SubIFD'),
473
		'RawDataUniqueID' => array('id' => '50781', 'tag' => 'RawDataUniqueID', 'categorie' => 'IFD0'),
474
		'AliasLayerMetadata' => array('id' => '50784', 'tag' => 'AliasLayerMetadata', 'categorie' => 'Unknown'),
475
		'OriginalRawFileName' => array('id' => '50827', 'tag' => 'OriginalRawFileName', 'categorie' => 'IFD0'),
476
		'OriginalRawFileData' => array('id' => '50828', 'tag' => 'OriginalRawFileData', 'categorie' => 'IFD0'),
477
		'ActiveArea' => array('id' => '50829', 'tag' => 'ActiveArea', 'categorie' => 'SubIFD'),
478
		'MaskedAreas' => array('id' => '50830', 'tag' => 'MaskedAreas', 'categorie' => 'SubIFD'),
479
		'AsShotICCProfile' => array('id' => '50831', 'tag' => 'AsShotICCProfile', 'categorie' => 'IFD0'),
480
		'AsShotPreProfileMatrix' => array('id' => '50832', 'tag' => 'AsShotPreProfileMatrix', 'categorie' => 'IFD0'),
481
		'CurrentICCProfile' => array('id' => '50833', 'tag' => 'CurrentICCProfile', 'categorie' => 'IFD0'),
482
		'CurrentPreProfileMatrix' => array('id' => '50834', 'tag' => 'CurrentPreProfileMatrix', 'categorie' => 'IFD0'),
483
		'ColorimetricReference' => array('id' => '50879', 'tag' => 'ColorimetricReference', 'categorie' => 'IFD0'),
484
		'PanasonicTitle' => array('id' => '50898', 'tag' => 'PanasonicTitle', 'categorie' => 'IFD0'),
485
		'PanasonicTitle2' => array('id' => '50899', 'tag' => 'PanasonicTitle2', 'categorie' => 'IFD0'),
486
		'CameraCalibrationSig' => array('id' => '50931', 'tag' => 'CameraCalibrationSig', 'categorie' => 'IFD0'),
487
		'ProfileCalibrationSig' => array('id' => '50932', 'tag' => 'ProfileCalibrationSig', 'categorie' => 'IFD0'),
488
		'ProfileIFD' => array('id' => '50933', 'tag' => 'ProfileIFD', 'categorie' => 'Unknown'),
489
		'AsShotProfileName' => array('id' => '50934', 'tag' => 'AsShotProfileName', 'categorie' => 'IFD0'),
490
		'NoiseReductionApplied' => array('id' => '50935', 'tag' => 'NoiseReductionApplied', 'categorie' => 'SubIFD'),
491
		'ProfileName' => array('id' => '50936', 'tag' => 'ProfileName', 'categorie' => 'IFD0'),
492
		'ProfileHueSatMapDims' => array('id' => '50937', 'tag' => 'ProfileHueSatMapDims', 'categorie' => 'IFD0'),
493
		'ProfileHueSatMapData1' => array('id' => '50938', 'tag' => 'ProfileHueSatMapData1', 'categorie' => 'IFD0'),
494
		'ProfileHueSatMapData2' => array('id' => '50939', 'tag' => 'ProfileHueSatMapData2', 'categorie' => 'IFD0'),
495
		'ProfileToneCurve' => array('id' => '50940', 'tag' => 'ProfileToneCurve', 'categorie' => 'IFD0'),
496
		'ProfileEmbedPolicy' => array('id' => '50941', 'tag' => 'ProfileEmbedPolicy', 'categorie' => 'IFD0'),
497
		'ProfileCopyright' => array('id' => '50942', 'tag' => 'ProfileCopyright', 'categorie' => 'IFD0'),
498
		'ForwardMatrix1' => array('id' => '50964', 'tag' => 'ForwardMatrix1', 'categorie' => 'IFD0'),
499
		'ForwardMatrix2' => array('id' => '50965', 'tag' => 'ForwardMatrix2', 'categorie' => 'IFD0'),
500
		'PreviewApplicationName' => array('id' => '50966', 'tag' => 'PreviewApplicationName', 'categorie' => 'IFD0'),
501
		'PreviewApplicationVersion' => array('id' => '50967', 'tag' => 'PreviewApplicationVersion', 'categorie' => 'IFD0'),
502
		'PreviewSettingsName' => array('id' => '50968', 'tag' => 'PreviewSettingsName', 'categorie' => 'IFD0'),
503
		'PreviewSettingsDigest' => array('id' => '50969', 'tag' => 'PreviewSettingsDigest', 'categorie' => 'IFD0'),
504
		'PreviewColorSpace' => array('id' => '50970', 'tag' => 'PreviewColorSpace', 'categorie' => 'IFD0'),
505
		'PreviewDateTime' => array('id' => '50971', 'tag' => 'PreviewDateTime', 'categorie' => 'IFD0'),
506
		'RawImageDigest' => array('id' => '50972', 'tag' => 'RawImageDigest', 'categorie' => 'IFD0'),
507
		'OriginalRawFileDigest' => array('id' => '50973', 'tag' => 'OriginalRawFileDigest', 'categorie' => 'IFD0'),
508
		'SubTileBlockSize' => array('id' => '50974', 'tag' => 'SubTileBlockSize', 'categorie' => 'Unknown'),
509
		'RowInterleaveFactor' => array('id' => '50975', 'tag' => 'RowInterleaveFactor', 'categorie' => 'Unknown'),
510
		'ProfileLookTableDims' => array('id' => '50981', 'tag' => 'ProfileLookTableDims', 'categorie' => 'IFD0'),
511
		'ProfileLookTableData' => array('id' => '50982', 'tag' => 'ProfileLookTableData', 'categorie' => 'IFD0'),
512
		'OpcodeList1' => array('id' => '51008', 'tag' => 'OpcodeList1', 'categorie' => 'Unknown'),
513
		'OpcodeList2' => array('id' => '51009', 'tag' => 'OpcodeList2', 'categorie' => 'Unknown'),
514
		'OpcodeList3' => array('id' => '51022', 'tag' => 'OpcodeList3', 'categorie' => 'Unknown'),
515
		'NoiseProfile' => array('id' => '51041', 'tag' => 'NoiseProfile', 'categorie' => 'Unknown'),
516
		'Padding' => array('id' => '59932', 'tag' => 'Padding', 'categorie' => 'ExifIFD'),
517
		'OffsetSchema' => array('id' => '59933', 'tag' => 'OffsetSchema', 'categorie' => 'ExifIFD'),
518
		'Lens' => array('id' => '65002', 'tag' => 'Lens', 'categorie' => 'ExifIFD'),
519
		'KDC_IFD' => array('id' => '65024', 'tag' => 'KDC_IFD', 'categorie' => 'Unknown'),
520
		'RawFile' => array('id' => '65100', 'tag' => 'RawFile', 'categorie' => 'ExifIFD'),
521
		'Converter' => array('id' => '65101', 'tag' => 'Converter', 'categorie' => 'ExifIFD'),
522
		'Exposure' => array('id' => '65105', 'tag' => 'Exposure', 'categorie' => 'ExifIFD'),
523
		'Shadows' => array('id' => '65106', 'tag' => 'Shadows', 'categorie' => 'ExifIFD'),
524
		'Brightness' => array('id' => '65107', 'tag' => 'Brightness', 'categorie' => 'ExifIFD'),
525
		'Sharpness:65110' => array('id' => '65110', 'tag' => 'Sharpness', 'categorie' => 'ExifIFD'),
526
		'Smoothness' => array('id' => '65111', 'tag' => 'Smoothness', 'categorie' => 'ExifIFD'),
527
		'MoireFilter' => array('id' => '65112', 'tag' => 'MoireFilter', 'categorie' => 'ExifIFD'),
528
		'FileName' => array('id' => 'php:1', 'tag' => 'FileName', 'categorie' => 'PhpFile'),
529
		'FileDateTime' => array('id' => 'php:2', 'tag' => 'FileDateTime', 'categorie' => 'PhpFile'),
530
		'FileSize' => array('id' => 'php:3', 'tag' => 'FileSize', 'categorie' => 'PhpFile'),
531
		'FileType' => array('id' => 'php:4', 'tag' => 'FileType', 'categorie' => 'PhpFile'),
532
		'MimeType' => array('id' => 'php:5', 'tag' => 'MimeType', 'categorie' => 'PhpFile'),
533
		'SectionsFound' => array('id' => 'php:6', 'tag' => 'SectionsFound', 'categorie' => 'PhpFile'),
534
		'JPEGInterchangeFormat' => array('id' => 'php:7', 'tag' => 'JPEGInterchangeFormat', 'categorie' => 'PhpThumbail'),
535
		'JPEGInterchangeFormatLength' => array('id' => 'php:8', 'tag' => 'JPEGInterchangeFormatLength', 'categorie' => 'PhpThumbail'),
536
		'Thumbnail.FileType' => array('id' => 'php:9', 'tag' => 'ThumbnailFileType', 'categorie' => 'PhpThumbail'),
537
		'Thumbnail.MimeType' => array('id' => 'php:10', 'tag' => 'ThumbnailMimeType', 'categorie' => 'PhpThumbail'),
538
		'Html' => array('id' => 'php:11', 'tag' => 'Html', 'categorie' => 'PhpComputed'),
539
		'IsColor' => array('id' => 'php:12', 'tag' => 'IsColor', 'categorie' => 'PhpComputed'),
540
		'ByteOrderMotorola' => array('id' => 'php:13', 'tag' => 'ByteOrderMotorola', 'categorie' => 'PhpComputed'),
541
		'ApertureFNumber' => array('id' => 'php:14', 'tag' => 'ApertureFNumber', 'categorie' => 'PhpComputed'),
542
		'UserCommentEncoding' => array('id' => 'php:15', 'tag' => 'UserCommentEncoding', 'categorie' => 'PhpComputed'),
543
		'ExifImageLength' => array('id' => 'php:16', 'tag' => 'ExifImageLength', 'categorie' => 'PhpComputed'),
544
		'InterOperabilityIndex' => array('id' => 'php:17', 'tag' => 'InterOperabilityIndex', 'categorie' => 'PhpComputed'),
545
		'InterOperabilityVersion' => array('id' => 'php:18', 'tag' => 'InterOperabilityVersion', 'categorie' => 'PhpComputed'),
546
		'SpecialMode' => array('id' => 'php:19', 'tag' => 'SpecialMode', 'categorie' => 'PhpComputed'),
547
		'JPEGQuality' => array('id' => 'php:20', 'tag' => 'JPEGQuality', 'categorie' => 'PhpComputed'),
548
		'Macro' => array('id' => 'php:21', 'tag' => 'Macro ', 'categorie' => 'PhpComputed'),
549
		'DigitalZoom' => array('id' => 'php:22', 'tag' => 'DigitalZoom', 'categorie' => 'PhpComputed'),
550
		'SoftwareRelease' => array('id' => 'php:23', 'tag' => 'SoftwareRelease', 'categorie' => 'PhpComputed'),
551
		'PictureInfo' => array('id' => 'php:24', 'tag' => 'PictureInfo', 'categorie' => 'PhpComputed'),
552
		'CameraId' => array('id' => 'php:25', 'tag' => 'CameraId', 'categorie' => 'PhpComputed'),
553
		'Gps' => array('id' => 'php:26', 'tag' => 'Gps', 'categorie' => 'PhpComputed'),
554
		'ACDComment' => array('id' => 'php:27', 'tag' => 'ACDComment', 'categorie' => 'PhpComputed'),
555
		'NewSubFile' => array('id' => 'php:28', 'tag' => 'NewSubFile', 'categorie' => 'PhpComputed'),
556
		'Comments' => array('id' => 'php:29', 'tag' => 'Comments', 'categorie' => 'PhpComputed'),
557
		'TIFF/EPStandardID' => array('id' => 'php:30', 'tag' => 'TIFFEPStandardID', 'categorie' => 'PhpComputed'),
558
		'ModeArray' => array('id' => 'php:31', 'tag' => 'ModeArray', 'categorie' => 'PhpComputed'),
559
		'ImageInfo' => array('id' => 'php:32', 'tag' => 'ImageInfo', 'categorie' => 'PhpComputed'),
560
		'FirmwareVersion' => array('id' => 'php:33', 'tag' => 'FirmwareVersion', 'categorie' => 'PhpComputed'),
561
		'Camera' => array('id' => 'php:34', 'tag' => 'Camera', 'categorie' => 'PhpComputed'),
562
		'CustomFunctions' => array('id' => 'php:35', 'tag' => 'CustomFunctions', 'categorie' => 'PhpComputed'),
563
		'CCDWidth' => array('id' => 'php:36', 'tag' => 'CCDWidth', 'categorie' => 'PhpComputed'),
564
		'FocusDistance' => array('id' => 'php:37', 'tag' => 'FocusDistance', 'categorie' => 'PhpComputed'),
565
		'Keywords' => array('id' => 'php:38', 'tag' => 'Keywords', 'categorie' => 'PhpComputed'),
566
		'GPSVersion' => array('id' => 'php:39', 'tag' => 'GPSVersion', 'categorie' => 'PhpComputed')
567
	);
1189 jpm 568
 
1198 jpm 569
	private $ids_tags_iptc = array(
570
		'1#000' => array('id' => '0', 'tag' => 'ApplicationRecordVersion', 'categorie' => 'EnvelopeRecord'),
571
		'1#090' => array('id' => '90', 'tag' => 'CodedCharacterSet', 'categorie' => 'EnvelopeRecord'),
572
		'2#003' => array('id' => '3', 'tag' => 'ObjectTypeReference', 'categorie' => 'ApplicationRecord'),
573
		'2#004' => array('id' => '4', 'tag' => 'ObjectAttributeReference', 'categorie' => 'ApplicationRecord'),
574
		'2#005' => array('id' => '5', 'tag' => 'ObjectName', 'categorie' => 'ApplicationRecord'),
575
		'2#007' => array('id' => '7', 'tag' => 'EditStatus', 'categorie' => 'ApplicationRecord'),
576
		'2#008' => array('id' => '8', 'tag' => 'EditorialUpdate', 'categorie' => 'ApplicationRecord'),
577
		'2#010' => array('id' => '10', 'tag' => 'Urgency', 'categorie' => 'ApplicationRecord'),
578
		'2#012' => array('id' => '12', 'tag' => 'SubjectReference', 'categorie' => 'ApplicationRecord'),
579
		'Category' => array('id' => '15', 'tag' => 'Category', 'categorie' => 'ApplicationRecord'),
580
		'2#015' => array('id' => '15', 'tag' => 'Category', 'categorie' => 'ApplicationRecord'),
581
		'2#020' => array('id' => '20', 'tag' => 'SupplementalCategories', 'categorie' => 'ApplicationRecord'),
582
		'2#022' => array('id' => '22', 'tag' => 'FixtureIdentifier', 'categorie' => 'ApplicationRecord'),
583
		'MotsCles' => array('id' => '25', 'tag' => 'Keywords', 'categorie' => 'ApplicationRecord'),
584
		'2#026' => array('id' => '26', 'tag' => 'ContentLocationCode', 'categorie' => 'ApplicationRecord'),
585
		'2#027' => array('id' => '27', 'tag' => 'ContentLocationName', 'categorie' => 'ApplicationRecord'),
586
		'2#030' => array('id' => '30', 'tag' => 'ReleaseDate', 'categorie' => 'ApplicationRecord'),
587
		'2#035' => array('id' => '35', 'tag' => 'ReleaseTime', 'categorie' => 'ApplicationRecord'),
588
		'2#037' => array('id' => '37', 'tag' => 'ExpirationDate', 'categorie' => 'ApplicationRecord'),
589
		'2#038' => array('id' => '38', 'tag' => 'ExpirationTime', 'categorie' => 'ApplicationRecord'),
590
		'2#040' => array('id' => '40', 'tag' => 'SpecialInstructions', 'categorie' => 'ApplicationRecord'),
591
		'2#042' => array('id' => '42', 'tag' => 'ActionAdvised', 'categorie' => 'ApplicationRecord'),
592
		'2#045' => array('id' => '45', 'tag' => 'ReferenceService', 'categorie' => 'ApplicationRecord'),
593
		'2#047' => array('id' => '47', 'tag' => 'ReferenceDate', 'categorie' => 'ApplicationRecord'),
594
		'2#050' => array('id' => '50', 'tag' => 'ReferenceNumber', 'categorie' => 'ApplicationRecord'),
595
		'2#055' => array('id' => '55', 'tag' => 'DateCreated', 'categorie' => 'ApplicationRecord'),
596
		'2#060' => array('id' => '60', 'tag' => 'TimeCreated', 'categorie' => 'ApplicationRecord'),
597
		'2#062' => array('id' => '62', 'tag' => 'DigitalCreationDate', 'categorie' => 'ApplicationRecord'),
598
		'2#063' => array('id' => '63', 'tag' => 'DigitalCreationTime', 'categorie' => 'ApplicationRecord'),
599
		'2#065' => array('id' => '65', 'tag' => 'OriginatingProgram', 'categorie' => 'ApplicationRecord'),
600
		'2#070' => array('id' => '70', 'tag' => 'ProgramVersion', 'categorie' => 'ApplicationRecord'),
601
		'2#075' => array('id' => '75', 'tag' => 'ObjectCycle', 'categorie' => 'ApplicationRecord'),
602
		'ByLine' => array('id' => '80', 'tag' => 'By-line', 'categorie' => 'ApplicationRecord'),
603
		'ByLineTitle' => array('id' => '85', 'tag' => 'By-lineTitle', 'categorie' => 'ApplicationRecord'),
604
		'City' => array('id' => '90', 'tag' => 'City', 'categorie' => 'ApplicationRecord'),
605
		'SubLocation' => array('id' => '92', 'tag' => 'Sub-location', 'categorie' => 'ApplicationRecord'),
606
		'ProvinceState' => array('id' => '95', 'tag' => 'Province-State', 'categorie' => 'ApplicationRecord'),
607
		'CountryPrimaryLocationCode' => array('id' => '100', 'tag' => 'Country-PrimaryLocationCode', 'categorie' => 'ApplicationRecord'),
608
		'CountryName' => array('id' => '101', 'tag' => 'Country-PrimaryLocationName', 'categorie' => 'ApplicationRecord'),
609
		'2#103' => array('id' => '103', 'tag' => 'OriginalTransmissionReference', 'categorie' => 'ApplicationRecord'),
610
		'Headline' => array('id' => '105', 'tag' => 'Headline', 'categorie' => 'ApplicationRecord'),
611
		'Credit' => array('id' => '110', 'tag' => 'Credit', 'categorie' => 'ApplicationRecord'),
612
		'2#115' => array('id' => '115', 'tag' => 'Source', 'categorie' => 'ApplicationRecord'),
613
		'CopyrightNotice' => array('id' => '116', 'tag' => 'CopyrightNotice', 'categorie' => 'ApplicationRecord'),
614
		'Contact' => array('id' => '118', 'tag' => 'Contact', 'categorie' => 'ApplicationRecord'),
615
		'2#120' => array('id' => '120', 'tag' => 'Caption-Abstract', 'categorie' => 'ApplicationRecord'),
616
		'2#121' => array('id' => '121', 'tag' => 'LocalCaption', 'categorie' => 'ApplicationRecord'),
617
		'2#122' => array('id' => '122', 'tag' => 'Writer-Editor', 'categorie' => 'ApplicationRecord'),
618
		'2#125' => array('id' => '125', 'tag' => 'RasterizedCaption', 'categorie' => 'ApplicationRecord'),
619
		'2#130' => array('id' => '130', 'tag' => 'ImageType', 'categorie' => 'ApplicationRecord'),
620
		'2#131' => array('id' => '131', 'tag' => 'ImageOrientation', 'categorie' => 'ApplicationRecord'),
621
		'2#135' => array('id' => '135', 'tag' => 'LanguageIdentifier', 'categorie' => 'ApplicationRecord'),
622
		'2#150' => array('id' => '150', 'tag' => 'AudioType', 'categorie' => 'ApplicationRecord'),
623
		'2#151' => array('id' => '151', 'tag' => 'AudioSamplingRate', 'categorie' => 'ApplicationRecord'),
624
		'2#152' => array('id' => '152', 'tag' => 'AudioSamplingResolution', 'categorie' => 'ApplicationRecord'),
625
		'2#153' => array('id' => '153', 'tag' => 'AudioDuration', 'categorie' => 'ApplicationRecord'),
626
		'2#154' => array('id' => '154', 'tag' => 'AudioOutcue', 'categorie' => 'ApplicationRecord'),
627
		'2#184' => array('id' => '184', 'tag' => 'JobID', 'categorie' => 'ApplicationRecord'),
628
		'2#185' => array('id' => '185', 'tag' => 'MasterDocumentID', 'categorie' => 'ApplicationRecord'),
629
		'2#186' => array('id' => '186', 'tag' => 'ShortDocumentID', 'categorie' => 'ApplicationRecord'),
630
		'2#187' => array('id' => '187', 'tag' => 'UniqueDocumentID', 'categorie' => 'ApplicationRecord'),
631
		'2#188' => array('id' => '188', 'tag' => 'OwnerID', 'categorie' => 'ApplicationRecord'),
632
		'2#200' => array('id' => '200', 'tag' => 'ObjectPreviewFileFormat', 'categorie' => 'ApplicationRecord'),
633
		'2#201' => array('id' => '201', 'tag' => 'ObjectPreviewFileVersion', 'categorie' => 'ApplicationRecord'),
634
		'2#202' => array('id' => '202', 'tag' => 'ObjectPreviewData', 'categorie' => 'ApplicationRecord'),
635
		'2#221' => array('id' => '221', 'tag' => 'Prefs', 'categorie' => 'ApplicationRecord'),
636
		'2#225' => array('id' => '225', 'tag' => 'ClassifyState', 'categorie' => 'ApplicationRecord'),
637
		'2#228' => array('id' => '228', 'tag' => 'SimilarityIndex', 'categorie' => 'ApplicationRecord'),
638
		'2#230' => array('id' => '230', 'tag' => 'DocumentNotes', 'categorie' => 'ApplicationRecord'),
639
		'2#231' => array('id' => '231', 'tag' => 'DocumentHistory', 'categorie' => 'ApplicationRecord'),
640
		'2#232' => array('id' => '232', 'tag' => 'ExifCameraInfo', 'categorie' => 'ApplicationRecord'),
641
		'2#242' => array('id' => '242', 'tag' => 'Unknown242', 'categorie' => 'Unknown'),
642
		'2#254' => array('id' => '254', 'tag' => 'Unknown254', 'categorie' => 'Unknown'),
643
		'2#255' => array('id' => '255', 'tag' => 'CatalogSets', 'categorie' => 'ApplicationRecord')
644
	);
1189 jpm 645
 
1224 jpm 646
	public function __construct(Conteneur $conteneur) {
647
		$bddMigration = $conteneur->getParametre('database_cel.database_migration');
648
		if ($bddMigration == null || $bddMigration == '') {
1160 aurelien 649
			echo 'Attention la variable de configuration database_migration dans la section database_cel, contenant la base de données d\'arrivée, doit être remplie '."\n";
650
			exit;
651
		}
1224 jpm 652
		$bddIdentification = $conteneur->getParametre('database_ident.database');
653
		if ($bddIdentification == null || $bddIdentification == '') {
1160 aurelien 654
			echo 'Attention la variable de configuration database dans la section database_ident, contenant la base de données utilisateurs, doit être remplie '."\n";
655
			exit;
1224 jpm 656
		}
657
 
658
		self::$bdd_cel_migration = $conteneur->getParametre('database_cel.database_migration');
659
		self::$bdd_utilisateurs = $conteneur->getParametre('database_ident.database');
660
 
661
		$this->bdd = $conteneur->getBdd();
662
		$this->script = $conteneur->getScript();
1189 jpm 663
 
1224 jpm 664
		$this->cle_id_metadonnees = array_merge($this->ids_tags_exif, $this->ids_tags_iptc);
665
	}
666
 
667
	/**
668
	 * Méthode appelée pour executer le script.
669
	 */
670
	public function executer($params) {
1160 aurelien 671
		echo "--MIGRATION DES IMAGES --------------------------------------\n";
672
		//1. TEMPORAIRE : vider les tables de destinations
673
		if (self::truncate) {
1224 jpm 674
			echo "-------------------------------------------------------------------\n";
675
			echo "  ETAPE 0. Vider les tables ... \n";
676
			echo "-------------------------------------------------------------------\n";
1189 jpm 677
			$nouvellesTables = array('cel_images', 'cel_obs_images');
1160 aurelien 678
			foreach ($nouvellesTables as $nomTable) {
679
				echo 'Vider la table '.$nomTable.'...';
680
				$requeteTruncate = 'TRUNCATE TABLE '.self::$bdd_cel_migration.'.'.$nomTable;
1224 jpm 681
				$resultatTruncate = $this->bdd->executer($requeteTruncate);
1160 aurelien 682
				echo "ok \n";
683
			}
684
		}
1189 jpm 685
 
1224 jpm 686
		echo "-------------------------------------------------------------------\n";
687
		echo "  ETAPE 1. Paramétrage ... \n";
688
		echo "-------------------------------------------------------------------\n";
1149 gduche 689
		$this->getUtilisateurs();
690
		$this->getObservations();
1189 jpm 691
 
1224 jpm 692
		echo "-------------------------------------------------------------------\n";
693
		echo "  ETAPE 2. Migration des images ... \n";
694
		echo "-------------------------------------------------------------------\n";
1160 aurelien 695
		$this->migrerImages();
1200 jpm 696
		$this->mettreANullPrenomNomVide();
1198 jpm 697
		$this->ordonnerImages();
1189 jpm 698
 
1224 jpm 699
		echo "-------------------------------------------------------------------\n";
700
		echo "  ETAPE 3. migration des liaisons obs images ... \n";
701
		echo "-------------------------------------------------------------------\n";
1181 aurelien 702
		$this->migrerLiaisonsObsImages();
1149 gduche 703
	}
1189 jpm 704
 
1149 gduche 705
	private function getUtilisateurs() {
1224 jpm 706
		echo "SELECTION DES UTILISATEURS\n";
1189 jpm 707
 
1198 jpm 708
		$requete = 'SELECT U_ID as id, U_MAIL as mail, U_NAME as nom, U_SURNAME as prenom, U_PASSWD as pass '.
709
			'FROM '.self::$bdd_utilisateurs.'.annuaire_tela';
1224 jpm 710
		$tableau_utilisateurs = $this->bdd->requeter($requete);
1189 jpm 711
 
1198 jpm 712
		foreach ($tableau_utilisateurs as &$utilisateur) {
1149 gduche 713
			$this->tableau_utilisateurs[$utilisateur['mail']] = $utilisateur;
714
		}
1189 jpm 715
 
1224 jpm 716
		echo sizeof($this->tableau_utilisateurs)." utilisateurs sélectionnés\n";
1149 gduche 717
	}
1189 jpm 718
 
1149 gduche 719
	private function getObservations() {
720
		$pas = 5000;
1198 jpm 721
		$nObs = 'SELECT COUNT(*) AS nb FROM cel_inventory';
1224 jpm 722
		$resultatNbObs = $this->bdd->requeter($nObs, Bdd::SQL_RETOUR_COLONNE);
723
		$nbObs = $resultatNbObs;
1198 jpm 724
		$maxLimite = $nbObs + $pas;
1189 jpm 725
 
1198 jpm 726
		for ($i = 0; $i < $maxLimite; $i += $pas ) {
1224 jpm 727
			$requete_selection_observations = "SELECT id, ordre, identifiant FROM cel_inventory LIMIT $i,$pas ";
728
			$tableau_observations = $this->bdd->requeter($requete_selection_observations);
1198 jpm 729
			foreach ($tableau_observations as &$obs) {
1149 gduche 730
				$this->tableau_observations[$obs['identifiant']][$obs['ordre']] = $obs['id'];
731
			}
1224 jpm 732
			$this->script->afficherAvancement('Selection des observations (par '.$pas.' )');
1149 gduche 733
		}
1224 jpm 734
		echo "\n";
1149 gduche 735
	}
1189 jpm 736
 
1149 gduche 737
	private function migrerImages() {
1198 jpm 738
		$pas = 100;
1189 jpm 739
 
1160 aurelien 740
		//Selectionner le nombre d'images
741
		$requeteNbImg = "SELECT COUNT(*) as nb FROM cel_images";
1224 jpm 742
		$fin = $this->bdd->requeter($requeteNbImg, BDD::SQL_RETOUR_COLONNE);
1198 jpm 743
		$maxLimite = $fin + $pas;
1189 jpm 744
 
1224 jpm 745
		for ($i = 0; $i <= $maxLimite ; $i += $pas) {
746
			$requete = "SELECT * FROM cel_images ORDER BY ci_id_image ASC LIMIT $i,$pas ";
747
			$images = $this->bdd->requeter($requete);
1189 jpm 748
			if (is_array($images)) {
1224 jpm 749
				$imagesNouvelles = array();
1198 jpm 750
				foreach ($images as $image) {
1224 jpm 751
					$image = $this->traiterLigneImage($image);
752
					$image = array_map(array($this, 'protegerSiNonNull'), $image);
753
					$imagesNouvelles[] = '('.implode(',', array_values($image)).')';
1149 gduche 754
				}
1189 jpm 755
 
1224 jpm 756
				$bdd = self::$bdd_cel_migration;
757
				$champs = implode(', ', array_keys($this->tableau_nouveau_ancien));
758
				$values = implode(',', $imagesNouvelles);
759
				$requete = "INSERT INTO $bdd.cel_images ($champs) VALUES $values ";
1198 jpm 760
				$migration_images = $this->executerRequeteSimple($requete);
1149 gduche 761
				if (!$migration_images) {
1224 jpm 762
					echo 'La migration des images '.$i.' à '.($i + count($images)).' a échoué '."\n";
1198 jpm 763
					file_put_contents('/home/jpm/requete.sql', $requete);
1149 gduche 764
				} else {
1224 jpm 765
					$this->script->afficherAvancement('Migration des images (par '.$pas.' )');
1189 jpm 766
				}
1149 gduche 767
			}
1189 jpm 768
 
1198 jpm 769
			if (count($images) < $pas) {
1224 jpm 770
				echo "\n";
1149 gduche 771
				return;
772
			}
773
		}
1198 jpm 774
	}
1189 jpm 775
 
1198 jpm 776
	private function ordonnerImages() {
777
		$requete = 'ALTER TABLE '.self::$bdd_cel_migration.'.cel_images ORDER BY id_image';
778
		$this->executerRequeteSimple($requete);
779
	}
780
 
1224 jpm 781
	private function executerRequeteSimple($requete) {
1198 jpm 782
		// Fonction de commodité pour afficher les requetes au lieu de les executer
783
		if (self::dry_run) {
784
			echo str_replace('),','),'."\n", $requete)."\n";
785
			return true;
786
		} else {
1224 jpm 787
			return $this->bdd->executer($requete);
1198 jpm 788
		}
1149 gduche 789
	}
1189 jpm 790
 
1149 gduche 791
	private function traiterLigneImage($image) {
792
		$nouvelle_image = array();
1189 jpm 793
 
794
		foreach ($this->tableau_nouveau_ancien as $nouveau_champ_image => $ancien_champ_image) {
1149 gduche 795
			if ($this->estUnChampATraiter($ancien_champ_image)) {
796
				if (method_exists($this,$ancien_champ_image)) {
797
					$nouvelle_image[$nouveau_champ_image] = $this->$ancien_champ_image($image);
798
				} else {
799
					echo 'methode manquante : '.$ancien_champ_image."\n";
800
					$nouvelle_image[$nouveau_champ_image] = '';
801
				}
802
			} else {
803
				$nouvelle_image[$nouveau_champ_image] = $image[$ancien_champ_image];
804
			}
805
		}
1189 jpm 806
 
1149 gduche 807
		return $nouvelle_image;
808
	}
1189 jpm 809
 
1149 gduche 810
	private function estUnChampATraiter($champ) {
811
		return strpos($champ, 'traiter') !== false;
812
	}
1189 jpm 813
 
1198 jpm 814
	private function protegerSiNonNull($valeur) {
815
		if ($valeur != 'NULL') {
1224 jpm 816
			$valeur = $this->bdd->proteger($valeur);
1149 gduche 817
		}
1198 jpm 818
		return $valeur;
1189 jpm 819
	}
820
 
1149 gduche 821
	private function traiterIdentifiantUtilisateur($ligne_image) {
822
		$mail_image = $ligne_image['ci_ce_utilisateur'];
1181 aurelien 823
		$retour = $this->renvoyerIdPourMigration($mail_image);
1189 jpm 824
 
1149 gduche 825
		return $retour;
826
	}
1189 jpm 827
 
1198 jpm 828
	private function renvoyerIdPourMigration($utilisateur) {
829
		// si tout les test suivant échouent, on garde l'utilisateur tel quel (cas de la chaine de session des utilisateur anonymes)
830
		$retour = $utilisateur;
831
		// si le mail correspond a un utilisateur de la bdd
832
		if (isset($this->tableau_utilisateurs[$utilisateur])) {
833
			// on renvoie son id
834
			$retour =  $this->tableau_utilisateurs[$utilisateur]['id'];
835
		} else {
836
			// sinon si c'est un mail inconnu, on garde le md5
837
			if($this->mailValide($utilisateur)) {
838
				$retour = md5($utilisateur);
839
			}
840
		}
841
		return $retour;
842
	}
843
 
1224 jpm 844
	private function mailValide($mail) {
1198 jpm 845
		// vérification bidon mais ça suffit pour ici
1224 jpm 846
		return !(strpos($mail, '@') === false);
1198 jpm 847
	}
848
 
1149 gduche 849
	private function traiterPrenomUtilisateur($ligne_image) {
850
		$mail_image = $ligne_image['ci_ce_utilisateur'];
851
		$retour = $mail_image;
1189 jpm 852
 
1149 gduche 853
		if (isset($this->tableau_utilisateurs[$mail_image])) {
1198 jpm 854
			$retour = self::formaterMotPremiereLettreChaqueMotEnMajuscule($this->tableau_utilisateurs[$mail_image]['prenom']);
1181 aurelien 855
		} else {
856
			$retour = '';
1149 gduche 857
		}
1189 jpm 858
 
1149 gduche 859
		return $retour;
860
	}
1189 jpm 861
 
1198 jpm 862
	public static function formaterMotPremiereLettreChaqueMotEnMajuscule($chaine, $encodage= 'UTF-8') {
863
		$chaine = str_replace('-', ' - ', $chaine);
864
		$chaine = mb_strtolower($chaine, $encodage);
865
		$chaine = mb_convert_case($chaine, MB_CASE_TITLE, $encodage);
866
		$chaine = str_replace(' - ', '-', $chaine);
867
		return $chaine;
868
	}
869
 
1149 gduche 870
	private function traiterNomUtilisateur($ligne_image) {
871
		$mail_image = $ligne_image['ci_ce_utilisateur'];
872
		$retour = $mail_image;
1189 jpm 873
 
1149 gduche 874
		if (isset($this->tableau_utilisateurs[$mail_image])) {
1198 jpm 875
			$retour = self::formaterMotEnMajuscule($this->tableau_utilisateurs[$mail_image]['nom']);
1181 aurelien 876
		} else {
877
			$retour = '';
1149 gduche 878
		}
1189 jpm 879
 
1149 gduche 880
		return $retour;
881
	}
1189 jpm 882
 
1198 jpm 883
	public static function formaterMotEnMajuscule($chaine, $encodage= 'UTF-8') {
884
		return mb_convert_case($chaine, MB_CASE_UPPER, $encodage);
1149 gduche 885
	}
1189 jpm 886
 
1198 jpm 887
	private function traiterNoteImage($image) {
888
		$retour = $image['ci_note_image'];
889
		if ($image['ci_note_image'] == '-1') {
890
			$retour = 'NULL';
1160 aurelien 891
		}
1198 jpm 892
		return $retour;
1149 gduche 893
	}
1189 jpm 894
 
1149 gduche 895
	private function traiterExif($ligne_image) {
896
		$metadonnees_autres = $this->decoderTableauMetaDonnees($ligne_image['ci_meta_exif_autres']);
897
		$metadonnees = array_intersect_key($ligne_image, array_flip($this->champs_exifs_non_gardes))+$metadonnees_autres;
1189 jpm 898
 
1198 jpm 899
		$retour = 'NULL';
900
		if ($xml = $this->convertirTableauMetadonneesEnXml($metadonnees)) {
901
			$retour = '<?xml version="1.0" encoding="UTF-8" ?>'."\n".
902
				'<exif>'."\n".$xml.'</exif>';
903
		}
904
		return $retour;
1149 gduche 905
	}
1189 jpm 906
 
1149 gduche 907
	private function traiterIptc($ligne_image) {
908
		$metadonnees_autres = $this->decoderTableauMetaDonnees($ligne_image['ci_meta_iptc_autres']);
1198 jpm 909
		$metadonnees = array_intersect_key($ligne_image, array_flip($this->champs_iptc_non_gardes)) + $metadonnees_autres;
1189 jpm 910
 
1198 jpm 911
		$retour = 'NULL';
912
		if ($xml = $this->convertirTableauMetadonneesEnXml($metadonnees)) {
913
			$retour = '<?xml version="1.0" encoding="UTF-8" ?>'."\n".
914
				'<iptc>'."\n".$xml.'</iptc>';
915
		}
916
		return $retour;
1149 gduche 917
	}
1189 jpm 918
 
1149 gduche 919
	private function traiterXmp($ligne_image) {
1198 jpm 920
		$retour = 'NULL';
921
		return $retour;
1149 gduche 922
	}
1189 jpm 923
 
1149 gduche 924
	private function traiterMakernote($ligne_image) {
1198 jpm 925
		$retour = 'NULL';
926
		return $retour;
1149 gduche 927
	}
1189 jpm 928
 
1198 jpm 929
	private function decoderTableauMetaDonnees($chaine) {
930
		$tableau_valeurs_decodees = array();
931
		if (trim($chaine) != '') {
932
			$tableau_meta = explode(self::separateur_champs_metadonnees, $chaine);
933
			foreach ($tableau_meta as &$chaine_meta) {
934
				if (strpos($chaine_meta, 'UndefinedTag:') !== false) {
935
					$chaine_meta = str_replace('UndefinedTag:', 'UndefinedTag', $chaine_meta);
936
				}
937
				$cle_valeur = explode(self::separateur_valeurs_metadonnees, $chaine_meta, 2);
938
				if (is_array($cle_valeur) && count($cle_valeur) == 2) {
939
					$cle = ltrim($cle_valeur[0], ' ');
940
					$tableau_valeurs_decodees[$cle] = $cle_valeur[1];
941
				}
942
			}
943
		}
944
		return $tableau_valeurs_decodees;
945
	}
946
 
947
	private function convertirTableauMetadonneesEnXml($tableau) {
948
		$xml = '';
949
		foreach ($tableau as $cle => $valeur) {
950
			$cle = str_replace('ci_meta_exif_', '', $cle);
951
			$cle = str_replace('ci_meta_iptc_', '', $cle);
952
			$cle = str_replace('ci_meta_', '', $cle);
953
 
954
			$cle = str_replace('_', ' ', $cle);
955
			$cle = ucwords($cle);
956
			$cle = str_replace(' ', '', $cle);
957
 
958
			$valeur = str_replace("\0", '', $valeur);
959
 
960
			if (isset($this->cle_id_metadonnees[$cle])) {
961
				$id = $this->cle_id_metadonnees[$cle]['id'];
962
				$tag = $this->cle_id_metadonnees[$cle]['tag'];
963
				$categorie = $this->cle_id_metadonnees[$cle]['categorie'];
964
				$xml .= '<'.$tag.' id="'.$id.'" categorie="'.$categorie.'">'.$valeur.'</'.$tag.'>'."\n";
965
			} else {
966
				$xml .= '<'.$cle.' categorie="Undefined">'.$valeur.'</'.$cle.'>'."\n";
967
			}
968
		}
969
		return $xml;
1149 gduche 970
	}
1189 jpm 971
 
1198 jpm 972
	private function migrerLiaisonsObsImages() {
973
		$pas = 500;
974
		$liaisons_obs_inexistantes = 0;
975
 
976
		//Selectionner le nombre de liaisons
977
		$requeteNbImgObs = "SELECT COUNT(*) AS nb FROM cel_obs_images";
1224 jpm 978
		$fin = $this->bdd->requeter($requeteNbImgObs, Bdd::SQL_RETOUR_COLONNE);
979
		echo "Nbre de liaisons à migrer  : $fin\n";
1198 jpm 980
 
1224 jpm 981
		for ($i = 0; $i <= $fin ; $i += $pas) {
982
			$requete = "SELECT * FROM cel_obs_images LIMIT $i,$pas ";
983
			$tableau_liaisons = $this->bdd->requeter($requete);
1198 jpm 984
 
985
			if (is_array($tableau_liaisons)) {
1224 jpm 986
				$liaisonsNouvelles = array();
987
				foreach ($tableau_liaisons as $liaison) {
1198 jpm 988
					$mail_utilisateur = $liaison['coi_ce_utilisateur'];
1224 jpm 989
					$ordre_obs = $liaison['coi_ce_observation'];
990
					if (isset($this->tableau_observations[$mail_utilisateur][$ordre_obs])) {
991
						$id_obs = $this->bdd->proteger($this->tableau_observations[$mail_utilisateur][$ordre_obs]);
992
						$id_image = $this->bdd->proteger($liaison['coi_ce_image']);
993
						$date_liaison = $this->bdd->proteger($liaison['coi_date_liaison']);
994
						$liaisonsNouvelles[] = "($id_image, $id_obs, $date_liaison)";
1198 jpm 995
					} else {
996
						// cas d'une observation inexistante, la liaison est ignorée
997
						$liaisons_obs_inexistantes++;
998
					}
1224 jpm 999
				}
1000
				if (count($liaisonsNouvelles) != 0) {
1001
					$sousRequete = implode(',', $liaisonsNouvelles);
1002
 
1003
					$requete = 'INSERT INTO '.self::$bdd_cel_migration.'.cel_obs_images '.
1004
							'(id_image, id_observation, date_liaison) '.
1005
							"VALUES $sousRequete ";
1006
					$migration_liaison = $this->executerRequeteSimple($requete);
1198 jpm 1007
 
1224 jpm 1008
					if (!$migration_liaison) {
1009
						echo 'La migration des liaisons obs images de '.$i.' à '.($i+$pas).' a échoué ! '."\n<br />";
1010
					} else {
1011
						$this->script->afficherAvancement('Migration des liaisons obs images (par '.$pas.' )');
1012
					}
1198 jpm 1013
				}
1014
			}
1015
		}
1016
		echo "\n";
1224 jpm 1017
		echo $liaisons_obs_inexistantes ? $liaisons_obs_inexistantes." liaisons image obs ont été ignorées car les obs sont absentes\n" : '' ;
1149 gduche 1018
	}
1200 jpm 1019
 
1020
	private function mettreANullPrenomNomVide() {
1021
		$bdd = self::$bdd_cel_migration;
1022
		$requete = 	"UPDATE $bdd.cel_images ".
1023
			'SET prenom_utilisateur = NULL '.
1024
			"WHERE prenom_utilisateur = '' ";
1224 jpm 1025
		$this->bdd->executer($requete);
1200 jpm 1026
 
1027
		$requete = 	"UPDATE $bdd.cel_images ".
1224 jpm 1028
			'SET nom_utilisateur = NULL '.
1029
			"WHERE nom_utilisateur = '' ";
1030
		$this->bdd->executer($requete);
1200 jpm 1031
	}
1149 gduche 1032
}