Subversion Repositories eFlore/Applications.cel

Rev

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