Subversion Repositories eFlore/Applications.cel

Rev

Rev 623 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 623 Rev 632
Line 8... Line 8...
8
 * @author Aurélien PERONNET <aurelien@tela-botanica.org>
8
 * @author Aurélien PERONNET <aurelien@tela-botanica.org>
9
 * @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
9
 * @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
10
 * @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
10
 * @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
11
 * @version $Id$
11
 * @version $Id$
12
 */
12
 */
13
class ExtracteurMetadonnees() {
13
class ExtracteurMetadonnees {
Line 14... Line 14...
14
 
14
 
15
	 public function extraireMetadonnees($chemin_fichier)
15
	 public function extraireMetadonnees($chemin_fichier)
Line 16... Line 16...
16
	 {
16
	 {
Line 28... Line 28...
28
	/**
28
	/**
29
	* Extraction des metadonnées exif 
29
	* Extraction des metadonnées exif 
30
	**/
30
	**/
31
	public function extraireExif($chemin_fichier)
31
	public function extraireExif($chemin_fichier)
32
	{
32
	{
33
		$exif_tab = $this->initialiserTableauExif() ;
33
		$exif_tab = $this->initialiserTableauExif () ;
Line 34... Line 34...
34
	
34
	
35
		$exif = exif_read_data($url,"EXIF,COMPUTED,IFD0,FILE,COMMENT",true,false);
35
		$exif = @exif_read_data($chemin_fichier,"EXIF,COMPUTED,IFD0,FILE,COMMENT",true,false);
-
 
36
 
36
					
37
		if ($exif) {
37
		foreach ($exif as $key => $section) 
38
			foreach ($exif as $key => $section) 
38
		{
39
			{
39
		    foreach ($section as $name => $val) 
40
			    foreach ($section as $name => $val) 
40
		    {
41
			    {
41
				if($name != "MakerNote")
42
					if ($name != "MakerNote")
42
				{
43
					{
43
						$this->decoderValeurExif($name, $val ,&$exif_tab) ;
44
							$this->decoderValeurExif ($name, $val ,&$exif_tab) ;
44
				}
45
					}
-
 
46
			    }
45
		    }
47
			}
Line 46... Line 48...
46
		}
48
		}
47
		
49
		
Line 60... Line 62...
60
		// s'il existe
62
		// s'il existe
61
		if (isset($info["APP13"])) 
63
		if (isset($info["APP13"])) 
62
		{
64
		{
63
			// on parse les donnees
65
			// on parse les donnees
64
			$iptc = iptcparse($info["APP13"]);
66
			$iptc = iptcparse($info["APP13"]);
-
 
67
			if ($iptc) {
65
			// et on les analyse
68
				// et on les analyse
66
			foreach($iptc as $marker => $section)
69
				foreach ($iptc as $marker => $section)
67
			{
-
 
68
				foreach($section as $nom => $val)
-
 
69
				{
70
				{
-
 
71
					foreach ($section as $nom => $val)
-
 
72
					{
70
					// pour remplir le tableau de donnees
73
						// pour remplir le tableau de donnees
71
					decoderValeurIptc($marker, $val ,&$iptc_tab) ;
74
						$this->decoderValeurIptc($marker, $val ,&$iptc_tab) ;
-
 
75
					}
72
				}
76
				}
73
			}
77
			}
74
		}
78
		}
Line 75... Line 79...
75
		
79
		
Line 82... Line 86...
82
	* @param String $val valeur
86
	* @param String $val valeur
83
	* @param String $data référence vers le tableau où la donnée sera stockée 
87
	* @param String $data référence vers le tableau où la donnée sera stockée 
84
	**/
88
	**/
85
	private function decoderValeurExif($nom, $val ,$data_tab)
89
	private function decoderValeurExif($nom, $val ,$data_tab)
86
	{	
90
	{	
87
		switch($nom)
91
		switch ($nom)
88
		{
92
		{
Line 89... Line 93...
89
		
93
		
90
			case "Height" :
94
			case "Height" :
91
			$data_tab['ci_meta_height'] = $val  ;
95
			$data_tab['ci_meta_height'] = $val  ;