Subversion Repositories eFlore/Applications.cel

Rev

Rev 1149 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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