Subversion Repositories eFlore/Applications.cel

Rev

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();
1200 jpm 688
		$this->mettreANullPrenomNomVide();
1198 jpm 689
		$this->ordonnerImages();
1149 gduche 690
		echo "\n"."\n"."\n";
1189 jpm 691
 
1160 aurelien 692
		echo "-------------------------------------------------------------------\n\n";
693
		echo "  ETAPE 3. migration des liaisons obs images ... \n\n";
694
		echo "-------------------------------------------------------------------\n\n";
1181 aurelien 695
		$this->migrerLiaisonsObsImages();
1149 gduche 696
		echo "\n"."\n"."\n";
697
	}
1189 jpm 698
 
1149 gduche 699
	private function getUtilisateurs() {
1160 aurelien 700
		echo "\n-------------------------------------------------------------------\n";
701
		echo "--SELECTION DES UTILISATEURS---------------------------------------\n\n";
1189 jpm 702
 
1198 jpm 703
		$requete = 'SELECT U_ID as id, U_MAIL as mail, U_NAME as nom, U_SURNAME as prenom, U_PASSWD as pass '.
704
			'FROM '.self::$bdd_utilisateurs.'.annuaire_tela';
705
		$tableau_utilisateurs = $this->executerRequete($requete);
1189 jpm 706
 
1198 jpm 707
		foreach ($tableau_utilisateurs as &$utilisateur) {
1149 gduche 708
			$this->tableau_utilisateurs[$utilisateur['mail']] = $utilisateur;
709
		}
1189 jpm 710
 
1160 aurelien 711
		echo sizeof($this->tableau_utilisateurs)." utilisateurs sélectionnés";
712
		echo "\n-----------------------------------------------------------------OK\n";
1149 gduche 713
	}
1189 jpm 714
 
1149 gduche 715
	private function getObservations() {
716
		$pas = 5000;
1198 jpm 717
		$nObs = 'SELECT COUNT(*) AS nb FROM cel_inventory';
1149 gduche 718
		$resultatNbObs = $this->executerRequete($nObs);
719
		$nbObs = $resultatNbObs[0]['nb'];
1198 jpm 720
		$maxLimite = $nbObs + $pas;
1189 jpm 721
 
1198 jpm 722
		for ($i = 0; $i < $maxLimite; $i += $pas ) {
1149 gduche 723
			$requete_selection_observations = 'SELECT id, ordre, identifiant FROM cel_inventory LIMIT '.$i.", $pas";
724
			$tableau_observations = $this->executerRequete($requete_selection_observations);
1198 jpm 725
			foreach ($tableau_observations as &$obs) {
1149 gduche 726
				$this->tableau_observations[$obs['identifiant']][$obs['ordre']] = $obs['id'];
727
			}
1198 jpm 728
			$this->afficherAvancement('Selection des observations (par '.$pas.' )');
1149 gduche 729
		}
1160 aurelien 730
		echo "\n\n";
1149 gduche 731
	}
1189 jpm 732
 
1149 gduche 733
	private function migrerImages() {
734
		$debut = 0;
1198 jpm 735
		$pas = 100;
1189 jpm 736
 
1160 aurelien 737
		//Selectionner le nombre d'images
738
		$requeteNbImg = "SELECT COUNT(*) as nb FROM cel_images";
739
		$resultatNbImg = $this->executerRequete($requeteNbImg);
740
		$fin = $resultatNbImg[0]['nb'];
1198 jpm 741
		$maxLimite = $fin + $pas;
1189 jpm 742
 
1198 jpm 743
		for ($i = $debut; $i <= $maxLimite ; $i += $pas) {
744
			$requete = 'SELECT * '.
745
				'FROM cel_images '.
746
				'ORDER BY ci_id_image ASC LIMIT '.$i.','.$pas;
1189 jpm 747
 
1198 jpm 748
			$images = @$this->requeter($requete);
749
			$requete = 'INSERT INTO '.self::$bdd_cel_migration.'.cel_images (';
1149 gduche 750
			foreach ($this->tableau_nouveau_ancien as $nouveau_champ => $ancien_champ) {
1198 jpm 751
				$requete .= $nouveau_champ.',';
1189 jpm 752
			}
1198 jpm 753
			$requete = rtrim($requete, ',').') VALUES ';
1189 jpm 754
 
755
			if (is_array($images)) {
1149 gduche 756
				$nb_images_a_traiter = count($images);
1198 jpm 757
				foreach ($images as $image) {
1149 gduche 758
					$nouvelle_image = $this->traiterLigneImage($image);
1198 jpm 759
					$nouvelle_image = array_map(array($this, 'protegerSiNonNull'), $nouvelle_image);
760
					$requete .= '('.join(',', array_values($nouvelle_image)).'),';
1149 gduche 761
				}
1189 jpm 762
 
1198 jpm 763
				$requete = rtrim($requete, ',');
764
				$migration_images = $this->executerRequeteSimple($requete);
1189 jpm 765
 
1149 gduche 766
				if (!$migration_images) {
1198 jpm 767
					echo 'la migration des images '.$i.' à '.($i + $nb_images_a_traiter).' a échoué '."\n";
768
					file_put_contents('/home/jpm/requete.sql', $requete);
1149 gduche 769
				} else {
1198 jpm 770
					$this->afficherAvancement('Migration des images (par '.$pas.' )');
1189 jpm 771
				}
1149 gduche 772
			}
1189 jpm 773
 
1198 jpm 774
			if (count($images) < $pas) {
1160 aurelien 775
				echo "\n---------------------------------------------------------------- OK\n\n";
1149 gduche 776
				return;
777
			}
778
		}
779
	}
1189 jpm 780
 
1198 jpm 781
	/**
782
	 * Utiliser cette méthode dans une boucle pour afficher un message suivi du nombre de tour de boucle effectué.
783
	 * Vous devrez vous même gérer le retour à la ligne à la sortie de la boucle.
784
	 *
785
	 * @param string le message d'information.
786
	 * @param int le nombre de départ à afficher.
787
	 * @return void le message est affiché dans la console.
788
	 */
789
	protected function afficherAvancement($message, $depart = 0) {
790
		if (! isset(self::$avancement[$message])) {
791
			self::$avancement[$message] = $depart;
792
			echo "$message : ";
793
 
794
			$actuel =& self::$avancement[$message];
795
			echo $actuel++;
796
		} else {
797
		$actuel =& self::$avancement[$message];
798
 
799
		// Cas du passage de 99 (= 2 caractères) à 100 (= 3 caractères)
800
		$passage = 0;
801
		if (strlen((string) ($actuel - 1)) < strlen((string) ($actuel))) {
802
		$passage = 1;
803
		}
804
		echo str_repeat(chr(8), (strlen((string) $actuel) - $passage));
805
		echo $actuel++;
806
		}
807
	}
1189 jpm 808
 
1198 jpm 809
	private function ordonnerImages() {
810
		$requete = 'ALTER TABLE '.self::$bdd_cel_migration.'.cel_images ORDER BY id_image';
811
		$this->executerRequeteSimple($requete);
812
	}
813
 
814
	public function executerRequeteSimple($requete) {
815
		// Fonction de commodité pour afficher les requetes au lieu de les executer
816
		if (self::dry_run) {
817
			echo str_replace('),','),'."\n", $requete)."\n";
818
			return true;
819
		} else {
820
			return parent::executerRequeteSimple($requete);
821
		}
1149 gduche 822
	}
1189 jpm 823
 
1149 gduche 824
	private function traiterLigneImage($image) {
825
		$nouvelle_image = array();
1189 jpm 826
 
827
		foreach ($this->tableau_nouveau_ancien as $nouveau_champ_image => $ancien_champ_image) {
1149 gduche 828
			if ($this->estUnChampATraiter($ancien_champ_image)) {
829
				if (method_exists($this,$ancien_champ_image)) {
830
					$nouvelle_image[$nouveau_champ_image] = $this->$ancien_champ_image($image);
831
				} else {
832
					echo 'methode manquante : '.$ancien_champ_image."\n";
833
					$nouvelle_image[$nouveau_champ_image] = '';
834
				}
835
			} else {
836
				$nouvelle_image[$nouveau_champ_image] = $image[$ancien_champ_image];
837
			}
838
		}
1189 jpm 839
 
1149 gduche 840
		return $nouvelle_image;
841
	}
1189 jpm 842
 
1149 gduche 843
	private function estUnChampATraiter($champ) {
844
		return strpos($champ, 'traiter') !== false;
845
	}
1189 jpm 846
 
1198 jpm 847
	private function protegerSiNonNull($valeur) {
848
		if ($valeur != 'NULL') {
849
			$valeur = $this->proteger($valeur);
1149 gduche 850
		}
1198 jpm 851
		return $valeur;
1189 jpm 852
	}
853
 
1149 gduche 854
	private function traiterIdentifiantUtilisateur($ligne_image) {
855
		$mail_image = $ligne_image['ci_ce_utilisateur'];
1181 aurelien 856
		$retour = $this->renvoyerIdPourMigration($mail_image);
1189 jpm 857
 
1149 gduche 858
		return $retour;
859
	}
1189 jpm 860
 
1198 jpm 861
	private function renvoyerIdPourMigration($utilisateur) {
862
		// si tout les test suivant échouent, on garde l'utilisateur tel quel (cas de la chaine de session des utilisateur anonymes)
863
		$retour = $utilisateur;
864
		// si le mail correspond a un utilisateur de la bdd
865
		if (isset($this->tableau_utilisateurs[$utilisateur])) {
866
			// on renvoie son id
867
			$retour =  $this->tableau_utilisateurs[$utilisateur]['id'];
868
		} else {
869
			// sinon si c'est un mail inconnu, on garde le md5
870
			if($this->mailValide($utilisateur)) {
871
				$retour = md5($utilisateur);
872
			}
873
		}
874
		return $retour;
875
	}
876
 
877
	public function mailValide($mail) {
878
		// vérification bidon mais ça suffit pour ici
879
		return !(strpos('@',$mail) === false);
880
	}
881
 
1149 gduche 882
	private function traiterPrenomUtilisateur($ligne_image) {
883
		$mail_image = $ligne_image['ci_ce_utilisateur'];
884
		$retour = $mail_image;
1189 jpm 885
 
1149 gduche 886
		if (isset($this->tableau_utilisateurs[$mail_image])) {
1198 jpm 887
			$retour = self::formaterMotPremiereLettreChaqueMotEnMajuscule($this->tableau_utilisateurs[$mail_image]['prenom']);
1181 aurelien 888
		} else {
889
			$retour = '';
1149 gduche 890
		}
1189 jpm 891
 
1149 gduche 892
		return $retour;
893
	}
1189 jpm 894
 
1198 jpm 895
	public static function formaterMotPremiereLettreChaqueMotEnMajuscule($chaine, $encodage= 'UTF-8') {
896
		$chaine = str_replace('-', ' - ', $chaine);
897
		$chaine = mb_strtolower($chaine, $encodage);
898
		$chaine = mb_convert_case($chaine, MB_CASE_TITLE, $encodage);
899
		$chaine = str_replace(' - ', '-', $chaine);
900
		return $chaine;
901
	}
902
 
1149 gduche 903
	private function traiterNomUtilisateur($ligne_image) {
904
		$mail_image = $ligne_image['ci_ce_utilisateur'];
905
		$retour = $mail_image;
1189 jpm 906
 
1149 gduche 907
		if (isset($this->tableau_utilisateurs[$mail_image])) {
1198 jpm 908
			$retour = self::formaterMotEnMajuscule($this->tableau_utilisateurs[$mail_image]['nom']);
1181 aurelien 909
		} else {
910
			$retour = '';
1149 gduche 911
		}
1189 jpm 912
 
1149 gduche 913
		return $retour;
914
	}
1189 jpm 915
 
1198 jpm 916
	public static function formaterMotEnMajuscule($chaine, $encodage= 'UTF-8') {
917
		return mb_convert_case($chaine, MB_CASE_UPPER, $encodage);
1149 gduche 918
	}
1189 jpm 919
 
1198 jpm 920
	private function traiterNoteImage($image) {
921
		$retour = $image['ci_note_image'];
922
		if ($image['ci_note_image'] == '-1') {
923
			$retour = 'NULL';
1160 aurelien 924
		}
1198 jpm 925
		return $retour;
1149 gduche 926
	}
1189 jpm 927
 
1149 gduche 928
	private function traiterExif($ligne_image) {
929
		$metadonnees_autres = $this->decoderTableauMetaDonnees($ligne_image['ci_meta_exif_autres']);
930
		$metadonnees = array_intersect_key($ligne_image, array_flip($this->champs_exifs_non_gardes))+$metadonnees_autres;
1189 jpm 931
 
1198 jpm 932
		$retour = 'NULL';
933
		if ($xml = $this->convertirTableauMetadonneesEnXml($metadonnees)) {
934
			$retour = '<?xml version="1.0" encoding="UTF-8" ?>'."\n".
935
				'<exif>'."\n".$xml.'</exif>';
936
		}
937
		return $retour;
1149 gduche 938
	}
1189 jpm 939
 
1149 gduche 940
	private function traiterIptc($ligne_image) {
941
		$metadonnees_autres = $this->decoderTableauMetaDonnees($ligne_image['ci_meta_iptc_autres']);
1198 jpm 942
		$metadonnees = array_intersect_key($ligne_image, array_flip($this->champs_iptc_non_gardes)) + $metadonnees_autres;
1189 jpm 943
 
1198 jpm 944
		$retour = 'NULL';
945
		if ($xml = $this->convertirTableauMetadonneesEnXml($metadonnees)) {
946
			$retour = '<?xml version="1.0" encoding="UTF-8" ?>'."\n".
947
				'<iptc>'."\n".$xml.'</iptc>';
948
		}
949
		return $retour;
1149 gduche 950
	}
1189 jpm 951
 
1149 gduche 952
	private function traiterXmp($ligne_image) {
1198 jpm 953
		$retour = 'NULL';
954
		return $retour;
1149 gduche 955
	}
1189 jpm 956
 
1149 gduche 957
	private function traiterMakernote($ligne_image) {
1198 jpm 958
		$retour = 'NULL';
959
		return $retour;
1149 gduche 960
	}
1189 jpm 961
 
1198 jpm 962
	private function decoderTableauMetaDonnees($chaine) {
963
		$tableau_valeurs_decodees = array();
964
		if (trim($chaine) != '') {
965
			$tableau_meta = explode(self::separateur_champs_metadonnees, $chaine);
966
			foreach ($tableau_meta as &$chaine_meta) {
967
				if (strpos($chaine_meta, 'UndefinedTag:') !== false) {
968
					$chaine_meta = str_replace('UndefinedTag:', 'UndefinedTag', $chaine_meta);
969
				}
970
				$cle_valeur = explode(self::separateur_valeurs_metadonnees, $chaine_meta, 2);
971
				if (is_array($cle_valeur) && count($cle_valeur) == 2) {
972
					$cle = ltrim($cle_valeur[0], ' ');
973
					$tableau_valeurs_decodees[$cle] = $cle_valeur[1];
974
				}
975
			}
976
		}
977
		return $tableau_valeurs_decodees;
978
	}
979
 
980
	private function convertirTableauMetadonneesEnXml($tableau) {
981
		$xml = '';
982
		foreach ($tableau as $cle => $valeur) {
983
			$cle = str_replace('ci_meta_exif_', '', $cle);
984
			$cle = str_replace('ci_meta_iptc_', '', $cle);
985
			$cle = str_replace('ci_meta_', '', $cle);
986
 
987
			$cle = str_replace('_', ' ', $cle);
988
			$cle = ucwords($cle);
989
			$cle = str_replace(' ', '', $cle);
990
 
991
			$valeur = str_replace("\0", '', $valeur);
992
 
993
			if (isset($this->cle_id_metadonnees[$cle])) {
994
				$id = $this->cle_id_metadonnees[$cle]['id'];
995
				$tag = $this->cle_id_metadonnees[$cle]['tag'];
996
				$categorie = $this->cle_id_metadonnees[$cle]['categorie'];
997
				$xml .= '<'.$tag.' id="'.$id.'" categorie="'.$categorie.'">'.$valeur.'</'.$tag.'>'."\n";
998
			} else {
999
				$xml .= '<'.$cle.' categorie="Undefined">'.$valeur.'</'.$cle.'>'."\n";
1000
			}
1001
		}
1002
		return $xml;
1149 gduche 1003
	}
1189 jpm 1004
 
1198 jpm 1005
	private function migrerLiaisonsObsImages() {
1006
		$debut = 0;
1007
		$pas = 500;
1008
 
1009
		$liaisons_obs_inexistantes = 0;
1010
 
1011
		//Selectionner le nombre de liaisons
1012
		$requeteNbImgObs = "SELECT COUNT(*) AS nb FROM cel_obs_images";
1013
		$resultatNbImgObs = $this->executerRequete($requeteNbImgObs);
1014
		$fin = $resultatNbImgObs[0]['nb'];
1015
 
1016
		for ($i = $debut; $i <= $fin ; $i += $pas) {
1017
			$requete = 'SELECT * FROM cel_obs_images LIMIT '.$i.','.$pas;
1018
			$tableau_liaisons = $this->executerRequete($requete);
1019
 
1020
			if (is_array($tableau_liaisons)) {
1021
				$requete = 'INSERT INTO '.self::$bdd_cel_migration.'.cel_obs_images '.
1022
						'(id_image, id_observation, date_liaison) '.
1023
						'VALUES ';
1024
 
1025
				$sous_requete = array();
1026
				foreach ($tableau_liaisons as &$liaison) {
1027
					$mail_utilisateur = $liaison['coi_ce_utilisateur'];
1028
					$id_obs = $liaison['coi_ce_observation'];
1029
 
1030
					if (isset($this->tableau_observations[$mail_utilisateur][$id_obs])) {
1031
						$id_obs = $this->tableau_observations[$mail_utilisateur][$id_obs];
1032
 
1033
						$sous_requete[] = '('.$this->proteger($liaison['coi_ce_image']).','.
1034
							$this->proteger($id_obs).','.
1035
							$this->proteger($liaison['coi_date_liaison']).
1036
							')';
1037
					} else {
1038
						// cas d'une observation inexistante, la liaison est ignorée
1039
						$liaisons_obs_inexistantes++;
1040
					}
1041
				}
1042
				$sous_requete = implode(',', $sous_requete);
1043
				$requete .= $sous_requete;
1044
				$migration_liaison = $this->executerRequeteSimple($requete);
1045
 
1046
				if (!$migration_liaison) {
1047
					echo 'La migration des liaisons obs images de '.$i.' à '.($i+$pas).' a échoué ! '."\n<br />";
1048
				} else {
1049
					$this->afficherAvancement('Migration des liaisons obs images (par '.$pas.' )');
1050
				}
1051
			}
1052
		}
1053
		echo "\n\n";
1054
		echo $liaisons_obs_inexistantes ? $liaisons_obs_inexistantes." liaisons image obs ont été ignorées car les obs sont absentes" : '' ;
1055
		echo "\n";
1056
		echo "\n---------------------------------------------------------------- OK\n\n";
1149 gduche 1057
	}
1200 jpm 1058
 
1059
	private function mettreANullPrenomNomVide() {
1060
		$bdd = self::$bdd_cel_migration;
1061
		$requete = 	"UPDATE $bdd.cel_images ".
1062
			'SET prenom_utilisateur = NULL '.
1063
			"WHERE prenom_utilisateur = '' ";
1064
		$this->executer($requete);
1065
 
1066
		$requete = 	"UPDATE $bdd.cel_images ".
1067
				'SET nom_utilisateur = NULL '.
1068
				"WHERE nom_utilisateur = '' ";
1069
		$this->executer($requete);
1070
	}
1149 gduche 1071
}