OVH Cloud OVH Cloud

lecture des exifs

14 réponses
Avatar
Dave
Bonjour,

Je n'y connais rien en internet mais je cherche un script tout fait juste
pour lire les exifs de mes photos et surtout
la latitude et la longitude qui se trouve dans la photo
y a t'il une ame genereuse qui pourrait m'indiquer l'endroit ou je peux
trouver ca ?

merci pour votre gentillesse

4 réponses

1 2
Avatar
Jean_
Dave nous dit :

Mais l… tu ne lis pas la longitude et la latitude de ton exif ,) c'est
ce qui m'interresse


POur pouvoir les lire, il faut qu'ils y soient. Comment veux-tu que
longitude et latitude arrivent par miracle dans l'exif ?

--
Jean.

Avatar
Stéphan Peccini
Le Tue, 28 Nov 2006 20:51:45 +0100, Dave a écrit:

Mais là tu ne lis pas la longitude et la latitude de ton exif ,) c'est ce
qui m'interresse


C'est la fonction exif_read_data en php. C'est tout.

function recuperer_exif($fichier) {
$exif = exif_read_data($fichier, 0, true);
if ($exif == FALSE) {
return(FALSE) ;
} ;
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
if (($key.$name == "GPSGPSLatitude") OR ($key.$name == "GPSGPSLongitude")) {
$tableau_exif[$key.$name] = sprintf("%s %s %s", $val[0], $val[1], $val[2]) ;
} else {
$tableau_exif[$key.$name] = $val ;
} ;
}
} ;
return($tableau_exif) ;
} ;


--
Stéphan Peccini
<URL:http://photonature.fr>

Avatar
Stéphan Peccini
Le Tue, 28 Nov 2006 20:23:57 +0000, Jean_ a écrit:

POur pouvoir les lire, il faut qu'ils y soient. Comment veux-tu que
longitude et latitude arrivent par miracle dans l'exif ?


Parce qu'on les y a mis. J'ai bon ? Et une fois qu'on les y a mis, c'est
tout de même pas mal de pouvoir les relire, non ?

--
Stéphan Peccini
<URL:http://photonature.fr>

Avatar
Stéphan Peccini
Le Wed, 29 Nov 2006 00:36:44 +0100, Filip Supera a écrit:

Je ne sais pas s'il est possible de lire des champs personnalisés
avec la bibliothèque standard de PHP. A étudier. Pas le temps en
ce moment. D'autres ici savent peut-être ? La doc en français est là :


La réponse est non avec exif_read_data. A voir avec la bibliothèque pel.

#!/usr/bin/php
<?php
function recuperer_exif($fichier) {
$exif = exif_read_data($fichier, 0, true);
if ($exif == FALSE) {
return(FALSE) ;
} ;
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
if (($key.$name == "GPSGPSLatitude") OR ($key.$name == "GPSGPSLongitude")) {
$tableau_exif[$key.$name] = sprintf("%s %s %s", $val[0], $val[1], $val[2]) ;
} else {
$tableau_exif[$key.$name] = $val ;
} ;
}
} ;
return($tableau_exif) ;
} ;
$tableau = recuperer_exif("/home/spc/Photos/Planches_diapos/Classeur_1/Page_28/1-28-01.jpg") ;
print_r($tableau) ;
?>

[ T]$ php test.php
Array
(
[FILEFileName] => 1-28-01.jpg
[FILEFileDateTime] => 1164484947
[FILEFileSize] => 381598
[FILEFileType] => 2
[FILEMimeType] => image/jpeg
[FILESectionsFound] => ANY_TAG, IFD0, COMMENT, EXIF, GPS
[COMPUTEDhtml] => width="536" height="800"
[COMPUTEDHeight] => 800
[COMPUTEDWidth] => 536
[COMPUTEDIsColor] => 1
[COMPUTEDByteOrderMotorola] => 0
[COMPUTEDApertureFNumber] => f/16.0
[COMPUTEDUserComment] => Réserve d'Orlu
[COMPUTEDUserCommentEncoding] => ASCII
[COMPUTEDCopyright] => Stephan Peccini
[IFD0ImageDescription] => Réserve d'Orlu
[IFD0Make] => Fuji
[IFD0Model] => Fuji GSW III 690 avec Velvia 100
[IFD0Software] => digiKam-0.9.0-rc1
[IFD0DateTime] => 2005:08:14 15:49:59
[IFD0Artist] => Stephan Peccini
[IFD0Copyright] => Stephan Peccini
[IFD0Exif_IFD_Pointer] => 246
[IFD0GPS_IFD_Pointer] => 450
[COMMENT0] => Réserve d'Orlu
[EXIFExposureTime] => 1/60
[EXIFFNumber] => 16/1
[EXIFISOSpeedRatings] => 100
[EXIFDateTimeOriginal] => 2005:08:14 15:49:59
[EXIFMeteringMode] => 1
[EXIFLightSource] => 1
[EXIFFlash] => 0
[EXIFFocalLength] => 65/1
[EXIFUserComment] => ASCIIRéserve d'Orlu
[EXIFExposureMode] => 1
[EXIFFocalLengthIn35mmFilm] => 28
[GPSGPSLatitudeRef] => N
[GPSGPSLatitude] => 42/1 3977/100 64/100
[GPSGPSLongitudeRef] => E
[GPSGPSLongitude] => 1/1 5804/100 87/100
[GPSGPSAltitudeRef] =>
[GPSGPSAltitude] => 1320/1
[GPSGPSMapDatum] => WGS-84
)
[ T]$ exiftool /home/spc/Photos/Planches_diapos/Classeur_1/Page_28/1-28-01.jpg
ExifTool Version Number : 6.53
File Name : 1-28-01.jpg
Directory : /home/spc/Photos/Planches_diapos/Classeur_1/Page_28
File Size : 373 kB
File Modification Date/Time : 2006:11:25 21:02:27
File Type : JPEG
MIME Type : image/jpeg
JFIF Version : 1.1
Resolution Unit : inches
X Resolution : 72
Y Resolution : 72
Comment : Réserve d'Orlu
Image Description : Réserve d'Orlu
Make : Fuji
Camera Model Name : Fuji GSW III 690 avec Velvia 100
Software : digiKam-0.9.0-rc1
Modify Date : 2005:08:14 15:49:59
Artist : Stephan Peccini
Copyright : Stephan Peccini
Exposure Time : 1/60
F Number : 16.0
ISO : 100
Date/Time Original : 2005:08:14 15:49:59
Metering Mode : Average
Light Source : Daylight
Flash : No Flash
Focal Length : 65.0mm
User Comment : Réserve d'Orlu
Exposure Mode : Manual
Focal Length In 35mm Format : 28
GPS Latitude Ref : North
GPS Latitude : 42 deg 39' 46.84"
GPS Longitude Ref : East
GPS Longitude : 1 deg 58' 3.27"
GPS Altitude Ref : Above Sea Level
GPS Altitude : 1320 metres
GPS Map Datum : WGS-84
Date Created : 2005:08:14
Time Created : 15:49:59+00:00
Originating Program : digiKam
Program Version : 0.9.0-rc1
Urgency : 5
By-line : Stephan Peccini
By-line Title :
Credit : Creative Commons by-nc-sa 2.5
Source :
Copyright Notice : Stephan Peccini
Caption-Abstract : Réserve d'Orlu
Keywords : Pyrenees, Pyrenees Orientales, Provia 100
Profile CMM Type : NKON
Profile Version : 2.2.0
Profile Class : Display Device Profile
Color Space Data : RGB
Profile Connection Space : XYZ
Profile Date Time : 2002:10:25 13:32:16
Profile File Signature : acsp
Primary Platform : Apple Computer Inc.
CMM Flags : Not Embedded, Independent
Device Manufacturer : none
Device Model :
Device Attributes : Reflective, Glossy, Positive, Color
Rendering Intent : Perceptual
Connection Space Illuminant : 0.9642 1 0.82491
Profile Creator :
Profile ID : 0
Profile Description : Nikon sRGB 4.0.0.3001
Red Matrix Column : 0.43607 0.2225 0.01392
Green Matrix Column : 0.38507 0.71687 0.09706
Blue Matrix Column : 0.14305 0.06061 0.71399
Media White Point : 0.9505 1 1.0891
Profile Copyright : Nikon Inc. & Nikon Corporation 2002
Red Tone Reproduction Curve : (Binary data 8204 bytes, use -b option to extract)
Green Tone Reproduction Curve : (Binary data 8204 bytes, use -b option to extract)
Blue Tone Reproduction Curve : (Binary data 8204 bytes, use -b option to extract)
Image Width : 536
Image Height : 800
Aperture : 16.0
Date/Time Created : 2005:08:14 15:49:59+00:00
GPS Position : 42 deg 39' 46.84" N, 1 deg 58' 3.27" E
Image Size : 536x800
Scale Factor To 35mm Equivalent : 0.4
Shutter Speed : 1/60
Circle Of Confusion : 0.070 mm
Focal Length : 65.0mm (35mm equivalent: 28.0mm)
Hyperfocal Distance : 3.79 m
LV : 13.9
[ T]$

--
Stéphan Peccini
<URL:http://photonature.fr>

1 2