Compare commits
10 Commits
fa176aba46
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| c4f180d439 | |||
| 0f8c34a39c | |||
| 72ef665afe | |||
| 8f5e96857a | |||
| edcfd078cf | |||
| eae1e44c01 | |||
| 6a29ca3de0 | |||
| a722102766 | |||
| c7cb1d7a02 | |||
| 3b26d798a9 |
1169
-child/exifer/exif.php
Executable file
426
-child/exifer/makers/canon.php
Executable file
@@ -0,0 +1,426 @@
|
||||
<?php //================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
/*
|
||||
Exifer
|
||||
Extracts EXIF information from digital photos.
|
||||
|
||||
Copyright © 2003 Jake Olefsky
|
||||
http://www.offsky.com/software/exif/index.php
|
||||
jake@olefsky.com
|
||||
|
||||
Please see exif.php for the complete information about this software.
|
||||
|
||||
------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
the GNU General Public License as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
|
||||
|
||||
//=================
|
||||
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
|
||||
//====================================================================
|
||||
function lookup_Canon_tag($tag) {
|
||||
|
||||
switch($tag) {
|
||||
case "0001": $tag = "Settings 1";break;
|
||||
case "0004": $tag = "Settings 4";break;
|
||||
case "0006": $tag = "ImageType";break;
|
||||
case "0007": $tag = "FirmwareVersion";break;
|
||||
case "0008": $tag = "ImageNumber";break;
|
||||
case "0009": $tag = "OwnerName";break;
|
||||
case "000c": $tag = "CameraSerialNumber";break;
|
||||
case "000f": $tag = "CustomFunctions";break;
|
||||
case "0095": $tag = "LensInfo";break;
|
||||
|
||||
default: $tag = "unknown:".$tag;break;
|
||||
}
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
//=================
|
||||
// Formats Data for the data type
|
||||
//====================================================================
|
||||
function formatCanonData($type,$tag,$intel,$data,$exif,&$result) {
|
||||
$place = 0;
|
||||
|
||||
|
||||
if($type=="ASCII") {
|
||||
$result = $data = str_replace("\0", "", $data);
|
||||
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
|
||||
$data = unRational($data,$type,$intel);
|
||||
|
||||
if($tag=="0204") { //DigitalZoom
|
||||
$data=$data."x";
|
||||
}
|
||||
|
||||
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
|
||||
$data = rational($data,$type,$intel);
|
||||
$result['RAWDATA'] = $data;
|
||||
|
||||
if($tag=="0001") { //first chunk
|
||||
$result['Bytes']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//0
|
||||
if ($result['Bytes'] != strlen($data) / 2) return $result; //Bad chunk
|
||||
$result['Macro']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//1
|
||||
switch($result['Macro']) {
|
||||
case 1: $result['Macro'] = gettext("Macro"); break;
|
||||
case 2: $result['Macro'] = gettext("Normal"); break;
|
||||
default: $result['Macro'] = gettext("Unknown");
|
||||
}
|
||||
$result['SelfTimer']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//2
|
||||
switch($result['SelfTimer']) {
|
||||
case 0: $result['SelfTimer'] = gettext("Off"); break;
|
||||
default: $result['SelfTimer'] .= gettext("/10s");
|
||||
}
|
||||
$result['Quality']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//3
|
||||
switch($result['Quality']) {
|
||||
case 2: $result['Quality'] = gettext("Normal"); break;
|
||||
case 3: $result['Quality'] = gettext("Fine"); break;
|
||||
case 5: $result['Quality'] = gettext("Superfine"); break;
|
||||
default: $result['Quality'] = gettext("Unknown");
|
||||
}
|
||||
$result['Flash']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//4
|
||||
switch($result['Flash']) {
|
||||
case 0: $result['Flash'] = gettext("Off"); break;
|
||||
case 1: $result['Flash'] = gettext("Auto"); break;
|
||||
case 2: $result['Flash'] = gettext("On"); break;
|
||||
case 3: $result['Flash'] = gettext("Red Eye Reduction"); break;
|
||||
case 4: $result['Flash'] = gettext("Slow Synchro"); break;
|
||||
case 5: $result['Flash'] = gettext("Auto + Red Eye Reduction"); break;
|
||||
case 6: $result['Flash'] = gettext("On + Red Eye Reduction"); break;
|
||||
case 16: $result['Flash'] = gettext("External Flash"); break;
|
||||
default: $result['Flash'] = gettext("Unknown");
|
||||
}
|
||||
$result['DriveMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//5
|
||||
switch($result['DriveMode']) {
|
||||
case 0: $result['DriveMode'] = gettext("Single/Timer"); break;
|
||||
case 1: $result['DriveMode'] = gettext("Continuous"); break;
|
||||
default: $result['DriveMode'] = gettext("Unknown");
|
||||
}
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//6
|
||||
$result['FocusMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//7
|
||||
switch($result['FocusMode']) {
|
||||
case 0: $result['FocusMode'] = gettext("One-Shot"); break;
|
||||
case 1: $result['FocusMode'] = gettext("AI Servo"); break;
|
||||
case 2: $result['FocusMode'] = gettext("AI Focus"); break;
|
||||
case 3: $result['FocusMode'] = gettext("Manual Focus"); break;
|
||||
case 4: $result['FocusMode'] = gettext("Single"); break;
|
||||
case 5: $result['FocusMode'] = gettext("Continuous"); break;
|
||||
case 6: $result['FocusMode'] = gettext("Manual Focus"); break;
|
||||
default: $result['FocusMode'] = gettext("Unknown");
|
||||
}
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//8
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//9
|
||||
$result['ImageSize']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//10
|
||||
switch($result['ImageSize']) {
|
||||
case 0: $result['ImageSize'] = gettext("Large"); break;
|
||||
case 1: $result['ImageSize'] = gettext("Medium"); break;
|
||||
case 2: $result['ImageSize'] = gettext("Small"); break;
|
||||
default: $result['ImageSize'] = gettext("Unknown");
|
||||
}
|
||||
$result['EasyShooting']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//11
|
||||
switch($result['EasyShooting']) {
|
||||
case 0: $result['EasyShooting'] = gettext("Full Auto"); break;
|
||||
case 1: $result['EasyShooting'] = gettext("Manual"); break;
|
||||
case 2: $result['EasyShooting'] = gettext("Landscape"); break;
|
||||
case 3: $result['EasyShooting'] = gettext("Fast Shutter"); break;
|
||||
case 4: $result['EasyShooting'] = gettext("Slow Shutter"); break;
|
||||
case 5: $result['EasyShooting'] = gettext("Night"); break;
|
||||
case 6: $result['EasyShooting'] = gettext("Black & White"); break;
|
||||
case 7: $result['EasyShooting'] = gettext("Sepia"); break;
|
||||
case 8: $result['EasyShooting'] = gettext("Portrait"); break;
|
||||
case 9: $result['EasyShooting'] = gettext("Sport"); break;
|
||||
case 10: $result['EasyShooting'] = gettext("Macro/Close-Up"); break;
|
||||
case 11: $result['EasyShooting'] = gettext("Pan Focus"); break;
|
||||
default: $result['EasyShooting'] = gettext("Unknown");
|
||||
}
|
||||
$result['DigitalZoom']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//12
|
||||
switch($result['DigitalZoom']) {
|
||||
case 0:
|
||||
case 65535: $result['DigitalZoom'] = gettext("None"); break;
|
||||
case 1: $result['DigitalZoom'] = gettext("2x"); break;
|
||||
case 2: $result['DigitalZoom'] = gettext("4x"); break;
|
||||
default: $result['DigitalZoom'] = gettext("Unknown");
|
||||
}
|
||||
$result['Contrast']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//13
|
||||
switch($result['Contrast']) {
|
||||
case 0: $result['Contrast'] = gettext("Normal"); break;
|
||||
case 1: $result['Contrast'] = gettext("High"); break;
|
||||
case 65535: $result['Contrast'] = gettext("Low"); break;
|
||||
default: $result['Contrast'] = gettext("Unknown");
|
||||
}
|
||||
$result['Saturation']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//14
|
||||
switch($result['Saturation']) {
|
||||
case 0: $result['Saturation'] = gettext("Normal"); break;
|
||||
case 1: $result['Saturation'] = gettext("High"); break;
|
||||
case 65535: $result['Saturation'] = gettext("Low"); break;
|
||||
default: $result['Saturation'] = gettext("Unknown");
|
||||
}
|
||||
$result['Sharpness']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//15
|
||||
switch($result['Sharpness']) {
|
||||
case 0: $result['Sharpness'] = gettext("Normal"); break;
|
||||
case 1: $result['Sharpness'] = gettext("High"); break;
|
||||
case 65535: $result['Sharpness'] = gettext("Low"); break;
|
||||
default: $result['Sharpness'] = gettext("Unknown");
|
||||
}
|
||||
$result['ISO']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//16
|
||||
switch($result['ISO']) {
|
||||
case 32767:
|
||||
case 0: $result['ISO'] = isset($exif['SubIFD']['ISOSpeedRatings'])
|
||||
? $exif['SubIFD']['ISOSpeedRatings'] : 'Unknown'; break;
|
||||
case 15: $result['ISO'] = gettext("Auto"); break;
|
||||
case 16: $result['ISO'] = gettext("50"); break;
|
||||
case 17: $result['ISO'] = gettext("100"); break;
|
||||
case 18: $result['ISO'] = gettext("200"); break;
|
||||
case 19: $result['ISO'] = gettext("400"); break;
|
||||
default: $result['ISO'] = gettext("Unknown");
|
||||
}
|
||||
$result['MeteringMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//17
|
||||
switch($result['MeteringMode']) {
|
||||
case 3: $result['MeteringMode'] = gettext("Evaluative"); break;
|
||||
case 4: $result['MeteringMode'] = gettext("Partial"); break;
|
||||
case 5: $result['MeteringMode'] = gettext("Center-weighted"); break;
|
||||
default: $result['MeteringMode'] = gettext("Unknown");
|
||||
}
|
||||
$result['FocusType']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//18
|
||||
switch($result['FocusType']) {
|
||||
case 0: $result['FocusType'] = gettext("Manual"); break;
|
||||
case 1: $result['FocusType'] = gettext("Auto"); break;
|
||||
case 3: $result['FocusType'] = gettext("Close-up (Macro)"); break;
|
||||
case 8: $result['FocusType'] = gettext("Locked (Pan Mode)"); break;
|
||||
default: $result['FocusType'] = gettext("Unknown");
|
||||
}
|
||||
$result['AFPointSelected']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//19
|
||||
switch($result['AFPointSelected']) {
|
||||
case 12288: $result['AFPointSelected'] = gettext("Manual Focus"); break;
|
||||
case 12289: $result['AFPointSelected'] = gettext("Auto Selected"); break;
|
||||
case 12290: $result['AFPointSelected'] = gettext("Right"); break;
|
||||
case 12291: $result['AFPointSelected'] = gettext("Center"); break;
|
||||
case 12292: $result['AFPointSelected'] = gettext("Left"); break;
|
||||
default: $result['AFPointSelected'] = gettext("Unknown");
|
||||
}
|
||||
$result['ExposureMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//20
|
||||
switch($result['ExposureMode']) {
|
||||
case 0: $result['ExposureMode'] = gettext("EasyShoot"); break;
|
||||
case 1: $result['ExposureMode'] = gettext("Program"); break;
|
||||
case 2: $result['ExposureMode'] = gettext("Tv"); break;
|
||||
case 3: $result['ExposureMode'] = gettext("Av"); break;
|
||||
case 4: $result['ExposureMode'] = gettext("Manual"); break;
|
||||
case 5: $result['ExposureMode'] = gettext("Auto-DEP"); break;
|
||||
default: $result['ExposureMode'] = gettext("Unknown");
|
||||
}
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//21
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//22
|
||||
$result['LongFocalLength']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//23
|
||||
$result['LongFocalLength'] .= " focal units";
|
||||
$result['ShortFocalLength']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//24
|
||||
$result['ShortFocalLength'] .= " focal units";
|
||||
$result['FocalUnits']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//25
|
||||
$result['FocalUnits'] .= " per mm";
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//26
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//27
|
||||
$result['FlashActivity']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//28
|
||||
switch($result['FlashActivity']) {
|
||||
case 0: $result['FlashActivity'] = gettext("Flash Did Not Fire"); break;
|
||||
case 1: $result['FlashActivity'] = gettext("Flash Fired"); break;
|
||||
default: $result['FlashActivity'] = gettext("Unknown");
|
||||
}
|
||||
$result['FlashDetails']=str_pad(base_convert(intel2Moto(substr($data,$place,4)), 16, 2), 16, "0", STR_PAD_LEFT);$place+=4;//29
|
||||
$flashDetails = array();
|
||||
if (substr($result['FlashDetails'], 1, 1) == 1) { $flashDetails[] = gettext('External E-TTL'); }
|
||||
if (substr($result['FlashDetails'], 2, 1) == 1) { $flashDetails[] = gettext('Internal Flash'); }
|
||||
if (substr($result['FlashDetails'], 4, 1) == 1) { $flashDetails[] = gettext('FP sync used'); }
|
||||
if (substr($result['FlashDetails'], 8, 1) == 1) { $flashDetails[] = gettext('2nd(rear)-curtain sync used'); }
|
||||
if (substr($result['FlashDetails'], 12, 1) == 1) { $flashDetails[] = gettext('1st curtain sync'); }
|
||||
$result['FlashDetails']=implode(",", $flashDetails);
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//30
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//31
|
||||
$anotherFocusMode=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//32
|
||||
if(strpos(strtoupper($exif['IFD0']['Model']), "G1") !== false) {
|
||||
switch($anotherFocusMode) {
|
||||
case 0: $result['FocusMode'] = gettext("Single"); break;
|
||||
case 1: $result['FocusMode'] = gettext("Continuous"); break;
|
||||
default: $result['FocusMode'] = gettext("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
} else if($tag=="0004") { //second chunk
|
||||
$result['Bytes']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//0
|
||||
if ($result['Bytes'] != strlen($data) / 2) return $result; //Bad chunk
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//1
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//2
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//3
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//4
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//5
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//6
|
||||
$result['WhiteBalance']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//7
|
||||
switch($result['WhiteBalance']) {
|
||||
case 0: $result['WhiteBalance'] = gettext("Auto"); break;
|
||||
case 1: $result['WhiteBalance'] = gettext("Sunny"); break;
|
||||
case 2: $result['WhiteBalance'] = gettext("Cloudy"); break;
|
||||
case 3: $result['WhiteBalance'] = gettext("Tungsten"); break;
|
||||
case 4: $result['WhiteBalance'] = gettext("Fluorescent"); break;
|
||||
case 5: $result['WhiteBalance'] = gettext("Flash"); break;
|
||||
case 6: $result['WhiteBalance'] = gettext("Custom"); break;
|
||||
default: $result['WhiteBalance'] = gettext("Unknown");
|
||||
}
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//8
|
||||
$result['SequenceNumber']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//9
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//10
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//11
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//12
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//13
|
||||
$result['AFPointUsed']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//14
|
||||
$afPointUsed = array();
|
||||
if ($result['AFPointUsed'] & 0x0001) $afPointUsed[] = gettext("Right"); //bit 0
|
||||
if ($result['AFPointUsed'] & 0x0002) $afPointUsed[] = gettext("Center"); //bit 1
|
||||
if ($result['AFPointUsed'] & 0x0004) $afPointUsed[] = gettext("Left"); //bit 2
|
||||
if ($result['AFPointUsed'] & 0x0800) $afPointUsed[] = gettext("12"); //bit 12
|
||||
if ($result['AFPointUsed'] & 0x1000) $afPointUsed[] = gettext("13"); //bit 13
|
||||
if ($result['AFPointUsed'] & 0x2000) $afPointUsed[] = gettext("14"); //bit 14
|
||||
if ($result['AFPointUsed'] & 0x4000) $afPointUsed[] = gettext("15"); //bit 15
|
||||
$result['AFPointUsed'] = implode(",", $afPointUsed);
|
||||
$result['FlashBias']=intel2Moto(substr($data,$place,4));$place+=4;//15
|
||||
switch($result['FlashBias']) {
|
||||
case 'ffc0': $result['FlashBias'] = "-2 EV"; break;
|
||||
case 'ffcc': $result['FlashBias'] = "-1.67 EV"; break;
|
||||
case 'ffd0': $result['FlashBias'] = "-1.5 EV"; break;
|
||||
case 'ffd4': $result['FlashBias'] = "-1.33 EV"; break;
|
||||
case 'ffe0': $result['FlashBias'] = "-1 EV"; break;
|
||||
case 'ffec': $result['FlashBias'] = "-0.67 EV"; break;
|
||||
case 'fff0': $result['FlashBias'] = "-0.5 EV"; break;
|
||||
case 'fff4': $result['FlashBias'] = "-0.33 EV"; break;
|
||||
case '0000': $result['FlashBias'] = "0 EV"; break;
|
||||
case '000c': $result['FlashBias'] = "0.33 EV"; break;
|
||||
case '0010': $result['FlashBias'] = "0.5 EV"; break;
|
||||
case '0014': $result['FlashBias'] = "0.67 EV"; break;
|
||||
case '0020': $result['FlashBias'] = "1 EV"; break;
|
||||
case '002c': $result['FlashBias'] = "1.33 EV"; break;
|
||||
case '0030': $result['FlashBias'] = "1.5 EV"; break;
|
||||
case '0034': $result['FlashBias'] = "1.67 EV"; break;
|
||||
case '0040': $result['FlashBias'] = "2 EV"; break;
|
||||
default: $result['FlashBias'] = gettext("Unknown");
|
||||
}
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//16
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//17
|
||||
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//18
|
||||
$result['SubjectDistance']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//19
|
||||
$result['SubjectDistance'] .= "/100 m";
|
||||
|
||||
} else if($tag=="0008") { //image number
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
$data=hexdec($data);
|
||||
$result = round($data/10000)."-".$data%10000;
|
||||
} else if($tag=="000c") { //camera serial number
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
$data=hexdec($data);
|
||||
$result = "#".bin2hex(substr($data,0,16)).substr($data,16,16);
|
||||
}
|
||||
|
||||
} else if($type=="UNDEFINED") {
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=================
|
||||
// Cannon Special data section
|
||||
// Useful: http://www.burren.cx/david/canon.html
|
||||
// http://www.burren.cx/david/canon.html
|
||||
// http://www.ozhiker.com/electronics/pjmt/jpeg_info/canon_mn.html
|
||||
//====================================================================
|
||||
function parseCanon($block,&$result,$seek, $globalOffset) {
|
||||
$place = 0; //current place
|
||||
|
||||
if($result['Endien']=="Intel") $intel=1;
|
||||
else $intel=0;
|
||||
|
||||
$model = $result['IFD0']['Model'];
|
||||
|
||||
//Get number of tags (2 bytes)
|
||||
$num = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $num = intel2Moto($num);
|
||||
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
|
||||
|
||||
//loop thru all tags Each field is 12 bytes
|
||||
for($i=0;$i<hexdec($num);$i++) {
|
||||
|
||||
//2 byte tag
|
||||
$tag = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $tag = intel2Moto($tag);
|
||||
$tag_name = lookup_Canon_tag($tag);
|
||||
|
||||
//2 byte type
|
||||
$type = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $type = intel2Moto($type);
|
||||
lookup_type($type,$size);
|
||||
|
||||
//4 byte count of number of data units
|
||||
$count = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $count = intel2Moto($count);
|
||||
$bytesofdata = validSize($size*hexdec($count));
|
||||
if($bytesofdata<=0) {
|
||||
return; //if this value is 0 or less then we have read all the tags we can
|
||||
}
|
||||
|
||||
//4 byte value of data or pointer to data
|
||||
$value = substr($block,$place,4);$place+=4;
|
||||
if($bytesofdata<=4) {
|
||||
$data = substr($value,0,$bytesofdata);
|
||||
} else {
|
||||
$value = bin2hex($value);
|
||||
if($intel==1) $value = intel2Moto($value);
|
||||
$v = fseek($seek,$globalOffset+hexdec($value)); //offsets are from TIFF header which is 12 bytes from the start of the file
|
||||
if (isset($GLOBALS['exiferFileSize'])) {
|
||||
$exiferFileSize = $GLOBALS['exiferFileSize'];
|
||||
} else {
|
||||
$exiferFileSize = 0;
|
||||
}
|
||||
if($v==0 && $bytesofdata < $exiferFileSize) {
|
||||
$data = fread($seek, $bytesofdata);
|
||||
} else if($v==-1) {
|
||||
$result['Errors'] = $result['Errors']++;
|
||||
$data = '';
|
||||
} else {
|
||||
$data = '';
|
||||
}
|
||||
}
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = ''; // insure the index exists
|
||||
$formated_data = formatCanonData($type,$tag,$intel,$data,$result,$result['SubIFD']['MakerNote'][$tag_name]);
|
||||
|
||||
if($result['VerboseOutput']==1) {
|
||||
//$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
|
||||
} else {
|
||||
//$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
247
-child/exifer/makers/fujifilm.php
Executable file
@@ -0,0 +1,247 @@
|
||||
<?php //================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
/*
|
||||
Exifer
|
||||
Extracts EXIF information from digital photos.
|
||||
|
||||
Copyright <20> 2003 Jake Olefsky
|
||||
http://www.offsky.com/software/exif/index.php
|
||||
jake@olefsky.com
|
||||
|
||||
Please see exif.php for the complete information about this software.
|
||||
|
||||
------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
the GNU General Public License as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
|
||||
|
||||
//=================
|
||||
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
|
||||
//====================================================================
|
||||
function lookup_Fujifilm_tag($tag) {
|
||||
|
||||
switch($tag) {
|
||||
case "0000": $tag = "Version";break;
|
||||
case "1000": $tag = "Quality";break;
|
||||
case "1001": $tag = "Sharpness";break;
|
||||
case "1002": $tag = "WhiteBalance";break;
|
||||
case "1003": $tag = "Color";break;
|
||||
case "1004": $tag = "Tone";break;
|
||||
case "1010": $tag = "FlashMode";break;
|
||||
case "1011": $tag = "FlashStrength";break;
|
||||
case "1020": $tag = "Macro";break;
|
||||
case "1021": $tag = "FocusMode";break;
|
||||
case "1030": $tag = "SlowSync";break;
|
||||
case "1031": $tag = "PictureMode";break;
|
||||
case "1100": $tag = "ContinuousTakingBracket";break;
|
||||
case "1200": $tag = "Unknown";break;
|
||||
case "1300": $tag = "BlurWarning";break;
|
||||
case "1301": $tag = "FocusWarning";break;
|
||||
case "1302": $tag = "AEWarning";break;
|
||||
|
||||
default: $tag = "unknown:".$tag;break;
|
||||
}
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
//=================
|
||||
// Formats Data for the data type
|
||||
//====================================================================
|
||||
function formatFujifilmData($type,$tag,$intel,$data) {
|
||||
|
||||
if($type=="ASCII") {
|
||||
|
||||
|
||||
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
|
||||
$data = unRational($data,$type,$intel);
|
||||
|
||||
if($tag=="1011") { //FlashStrength
|
||||
$data=$data." EV";
|
||||
}
|
||||
|
||||
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data =rational($data,$type,$intel);
|
||||
|
||||
if($tag=="1001") { //Sharpness
|
||||
if($data == 1) $data = gettext("Soft");
|
||||
else if($data == 2) $data = gettext("Soft");
|
||||
else if($data == 3) $data = gettext("Normal");
|
||||
else if($data == 4) $data = gettext("Hard");
|
||||
else if($data == 5) $data = gettext("Hard");
|
||||
else $data = gettext("Unknown").": ".$data;
|
||||
}
|
||||
if($tag=="1002") { //WhiteBalance
|
||||
if($data == 0) $data = gettext("Auto");
|
||||
else if($data == 256) $data = gettext("Daylight");
|
||||
else if($data == 512) $data = gettext("Cloudy");
|
||||
else if($data == 768) $data = gettext("DaylightColor-fluorescence");
|
||||
else if($data == 769) $data = gettext("DaywhiteColor-fluorescence");
|
||||
else if($data == 770) $data = gettext("White-fluorescence");
|
||||
else if($data == 1024) $data = gettext("Incandescence");
|
||||
else if($data == 3840) $data = gettext("Custom");
|
||||
else $data = gettext("Unknown").": ".$data;
|
||||
}
|
||||
if($tag=="1003") { //Color
|
||||
if($data == 0) $data = gettext("Chroma Saturation Normal(STD)");
|
||||
else if($data == 256) $data = gettext("Chroma Saturation High");
|
||||
else if($data == 512) $data = gettext("Chroma Saturation Low(ORG)");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1004") { //Tone
|
||||
if($data == 0) $data = gettext("Contrast Normal(STD)");
|
||||
else if($data == 256) $data = gettext("Contrast High(HARD)");
|
||||
else if($data == 512) $data = gettext("Contrast Low(ORG)");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1010") { //FlashMode
|
||||
if($data == 0) $data = gettext("Auto");
|
||||
else if($data == 1) $data = gettext("On");
|
||||
else if($data == 2) $data = gettext("Off");
|
||||
else if($data == 3) $data = gettext("Red-Eye Reduction");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1020") { //Macro
|
||||
if($data == 0) $data = gettext("Off");
|
||||
else if($data == 1) $data = gettext("On");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1021") { //FocusMode
|
||||
if($data == 0) $data = gettext("Auto");
|
||||
else if($data == 1) $data = gettext("Manual");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1030") { //SlowSync
|
||||
if($data == 0) $data = gettext("Off");
|
||||
else if($data == 1) $data = gettext("On");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1031") { //PictureMode
|
||||
if($data == 0) $data = gettext("Auto");
|
||||
else if($data == 1) $data = gettext("Portrait");
|
||||
else if($data == 2) $data = gettext("Landscape");
|
||||
else if($data == 4) $data = gettext("Sports");
|
||||
else if($data == 5) $data = gettext("Night");
|
||||
else if($data == 6) $data = gettext("Program AE");
|
||||
else if($data == 256) $data = gettext("Aperture Priority AE");
|
||||
else if($data == 512) $data = gettext("Shutter Priority");
|
||||
else if($data == 768) $data = gettext("Manual Exposure");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1100") { //ContinuousTakingBracket
|
||||
if($data == 0) $data = gettext("Off");
|
||||
else if($data == 1) $data = gettext("On");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1300") { //BlurWarning
|
||||
if($data == 0) $data = gettext("No Warning");
|
||||
else if($data == 1) $data = gettext("Warning");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1301") { //FocusWarning
|
||||
if($data == 0) $data = gettext("Auto Focus Good");
|
||||
else if($data == 1) $data = gettext("Out of Focus");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
if($tag=="1302") { //AEWarning
|
||||
if($data == 0) $data = gettext("AE Good");
|
||||
else if($data == 1) $data = gettext("Over Exposure");
|
||||
else $data = gettext("Unknown: ").$data;
|
||||
}
|
||||
} else if($type=="UNDEFINED") {
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=================
|
||||
// Fujifilm Special data section
|
||||
//====================================================================
|
||||
function parseFujifilm($block,&$result) {
|
||||
|
||||
//if($result['Endien']=="Intel") $intel=1;
|
||||
//else $intel=0;
|
||||
$intel=1;
|
||||
|
||||
$model = $result['IFD0']['Model'];
|
||||
|
||||
$place=8; //current place
|
||||
$offset=8;
|
||||
|
||||
|
||||
$num = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $num = intel2Moto($num);
|
||||
$result['SubIFD']['MakerNote']['Offset'] = hexdec($num);
|
||||
|
||||
//Get number of tags (2 bytes)
|
||||
$num = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $num = intel2Moto($num);
|
||||
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
|
||||
|
||||
//loop thru all tags Each field is 12 bytes
|
||||
for($i=0;$i<hexdec($num);$i++) {
|
||||
|
||||
//2 byte tag
|
||||
$tag = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $tag = intel2Moto($tag);
|
||||
$tag_name = lookup_Fujifilm_tag($tag);
|
||||
|
||||
//2 byte type
|
||||
$type = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $type = intel2Moto($type);
|
||||
lookup_type($type,$size);
|
||||
|
||||
//4 byte count of number of data units
|
||||
$count = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $count = intel2Moto($count);
|
||||
$bytesofdata = validSize($size*hexdec($count));
|
||||
|
||||
//4 byte value of data or pointer to data
|
||||
$value = substr($block,$place,4);$place+=4;
|
||||
|
||||
|
||||
if($bytesofdata<=4) {
|
||||
$data = substr($value,0,$bytesofdata);
|
||||
} else {
|
||||
$value = bin2hex($value);
|
||||
if($intel==1) $value = intel2Moto($value);
|
||||
$data = substr($block,hexdec($value)-$offset,$bytesofdata*2);
|
||||
}
|
||||
$formated_data = formatFujifilmData($type,$tag,$intel,$data);
|
||||
|
||||
if($result['VerboseOutput']==1) {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
|
||||
} else {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
218
-child/exifer/makers/gps.php
Executable file
@@ -0,0 +1,218 @@
|
||||
<?php //================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
/*
|
||||
Exifer
|
||||
Extracts EXIF information from digital photos.
|
||||
|
||||
Copyright © 2003 Jake Olefsky
|
||||
http://www.offsky.com/software/exif/index.php
|
||||
jake@olefsky.com
|
||||
|
||||
Please see exif.php for the complete information about this software.
|
||||
|
||||
------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
the GNU General Public License as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
|
||||
|
||||
|
||||
//=================
|
||||
// Looks up the name of the tag
|
||||
//====================================================================
|
||||
function lookup_GPS_tag($tag) {
|
||||
|
||||
switch($tag) {
|
||||
case "0000": $tag = "Version";break;
|
||||
case "0001": $tag = "Latitude Reference";break; //north or south
|
||||
case "0002": $tag = "Latitude";break; //dd mm.mm or dd mm ss
|
||||
case "0003": $tag = "Longitude Reference";break; //east or west
|
||||
case "0004": $tag = "Longitude";break; //dd mm.mm or dd mm ss
|
||||
case "0005": $tag = "Altitude Reference";break; //sea level or below sea level
|
||||
case "0006": $tag = "Altitude";break; //positive rational number
|
||||
case "0007": $tag = "Time";break; //three positive rational numbers
|
||||
case "0008": $tag = "Satellite";break; //text string up to 999 bytes long
|
||||
case "0009": $tag = "ReceiveStatus";break; //in progress or interop
|
||||
case "000a": $tag = "MeasurementMode";break; //2D or 3D
|
||||
case "000b": $tag = "MeasurementPrecision";break; //positive rational number
|
||||
case "000c": $tag = "SpeedUnit";break; //KPH, MPH, knots
|
||||
case "000d": $tag = "ReceiverSpeed";break; //positive rational number
|
||||
case "000e": $tag = "MovementDirectionRef";break; //true or magnetic north
|
||||
case "000f": $tag = "MovementDirection";break; //positive rational number
|
||||
case "0010": $tag = "ImageDirectionRef";break; //true or magnetic north
|
||||
case "0011": $tag = "ImageDirection";break; //positive rational number
|
||||
case "0012": $tag = "GeodeticSurveyData";break; //text string up to 999 bytes long
|
||||
case "0013": $tag = "DestLatitudeRef";break; //north or south
|
||||
case "0014": $tag = "DestinationLatitude";break; //three positive rational numbers
|
||||
case "0015": $tag = "DestLongitudeRef";break; //east or west
|
||||
case "0016": $tag = "DestinationLongitude";break; //three positive rational numbers
|
||||
case "0017": $tag = "DestBearingRef";break; //true or magnetic north
|
||||
case "0018": $tag = "DestinationBearing";break; //positive rational number
|
||||
case "0019": $tag = "DestDistanceRef";break; //km, miles, knots
|
||||
case "001a": $tag = "DestinationDistance";break; //positive rational number
|
||||
case "001b": $tag = "ProcessingMethod";break;
|
||||
case "001c": $tag = "AreaInformation";break;
|
||||
case "001d": $tag = "Datestamp";break; //text string 10 bytes long
|
||||
case "001e": $tag = "DifferentialCorrection";break; //integer in range 0-65535
|
||||
|
||||
|
||||
default: $tag = "unknown:".$tag;break;
|
||||
}
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
//=================
|
||||
// Formats Data for the data type
|
||||
//====================================================================
|
||||
function formatGPSData($type,$tag,$intel,$data) {
|
||||
|
||||
if($type=="ASCII") {
|
||||
if($tag=="0001" || $tag=="0003"){ // Latitude Reference, Longitude Reference
|
||||
$data = ($data{1} == @$data{2} && @$data{1} == @$data{3}) ? $data{0} : $data;
|
||||
}
|
||||
|
||||
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
|
||||
if($tag=="0002" || $tag=="0004" || $tag=='0007') { //Latitude, Longitude, Time
|
||||
$datum = array();
|
||||
for ($i=0;$i<strlen($data);$i=$i+8) {
|
||||
array_push($datum,substr($data, $i, 8));
|
||||
}
|
||||
$hour = unRational($datum[0],$type,$intel);
|
||||
$minutes = unRational($datum[1],$type,$intel);
|
||||
$seconds = unRational($datum[2],$type,$intel);
|
||||
if($tag=="0007") { //Time
|
||||
$data = $hour.":".$minutes.":".$seconds;
|
||||
} else {
|
||||
$data = $hour+$minutes/60+$seconds/3600;
|
||||
}
|
||||
} else {
|
||||
$data = unRational($data,$type,$intel);
|
||||
|
||||
if($tag=="0006"){
|
||||
$data .= 'm';
|
||||
}
|
||||
}
|
||||
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = rational($data,$type,$intel);
|
||||
|
||||
|
||||
} else if($type=="UNDEFINED") {
|
||||
|
||||
|
||||
|
||||
} else if($type=="UBYTE") {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $num = intel2Moto($data);
|
||||
|
||||
|
||||
if($tag=="0000") { // VersionID
|
||||
$data = hexdec(substr($data,0,2)) .
|
||||
".". hexdec(substr($data,2,2)) .
|
||||
".". hexdec(substr($data,4,2)) .
|
||||
".". hexdec(substr($data,6,2));
|
||||
|
||||
} else if($tag=="0005"){ // Altitude Reference
|
||||
if($data == "00000000"){ $data = '+'; }
|
||||
else if($data == "01000000"){ $data = '-'; }
|
||||
}
|
||||
|
||||
} else {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
//=================
|
||||
// GPS Special data section
|
||||
// Useful websites
|
||||
// http://drewnoakes.com/code/exif/sampleOutput.html
|
||||
// http://www.geosnapper.com
|
||||
//====================================================================
|
||||
function parseGPS($block,&$result,$offset,$seek, $globalOffset) {
|
||||
|
||||
if($result['Endien']=="Intel") $intel=1;
|
||||
else $intel=0;
|
||||
|
||||
$v = fseek($seek,$globalOffset+$offset); //offsets are from TIFF header which is 12 bytes from the start of the file
|
||||
if($v==-1) {
|
||||
$result['Errors'] = $result['Errors']++;
|
||||
}
|
||||
|
||||
$num = bin2hex(fread( $seek, 2 ));
|
||||
if($intel==1) $num = intel2Moto($num);
|
||||
$num=hexdec($num);
|
||||
$result['GPS']['NumTags'] = $num;
|
||||
|
||||
if ($num == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$block = fread( $seek, $num*12 );
|
||||
$place = 0;
|
||||
|
||||
//loop thru all tags Each field is 12 bytes
|
||||
for($i=0;$i<$num;$i++) {
|
||||
//2 byte tag
|
||||
$tag = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $tag = intel2Moto($tag);
|
||||
$tag_name = lookup_GPS_tag($tag);
|
||||
|
||||
//2 byte datatype
|
||||
$type = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $type = intel2Moto($type);
|
||||
lookup_type($type,$size);
|
||||
|
||||
//4 byte number of elements
|
||||
$count = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $count = intel2Moto($count);
|
||||
$bytesofdata = validSize($size*hexdec($count));
|
||||
|
||||
//4 byte value or pointer to value if larger than 4 bytes
|
||||
$value = substr($block,$place,4);$place+=4;
|
||||
if($bytesofdata<=4) {
|
||||
$data = substr($value,0,$bytesofdata);
|
||||
} else {
|
||||
if (strpos('unknown',$tag_name) !== false || $bytesofdata > 1024) {
|
||||
$result['Errors'] = $result['Errors']++;
|
||||
$data = '';
|
||||
$type = 'ASCII';
|
||||
} else {
|
||||
$value = bin2hex($value);
|
||||
if($intel==1) $value = intel2Moto($value);
|
||||
$v = fseek($seek,$globalOffset+hexdec($value)); //offsets are from TIFF header which is 12 bytes from the start of the file
|
||||
if($v==0) {
|
||||
$data = fread($seek, $bytesofdata);
|
||||
} else {
|
||||
$result['Errors'] = $result['Errors']++;
|
||||
$data = '';
|
||||
$type = 'ASCII';
|
||||
}
|
||||
}
|
||||
}
|
||||
if($result['VerboseOutput']==1) {
|
||||
$result['GPS'][$tag_name] = formatGPSData($type,$tag,$intel,$data);
|
||||
$result['GPS'][$tag_name."_Verbose"]['RawData'] = bin2hex($data);
|
||||
$result['GPS'][$tag_name."_Verbose"]['Type'] = $type;
|
||||
$result['GPS'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
|
||||
} else {
|
||||
$result['GPS'][$tag_name] = formatGPSData($type,$tag,$intel,$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
411
-child/exifer/makers/nikon.php
Executable file
@@ -0,0 +1,411 @@
|
||||
<?php //================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
/*
|
||||
Exifer
|
||||
Extracts EXIF information from digital photos.
|
||||
|
||||
Copyright <20> 2003 Jake Olefsky
|
||||
http://www.offsky.com/software/exif/index.php
|
||||
jake@olefsky.com
|
||||
|
||||
Please see exif.php for the complete information about this software.
|
||||
|
||||
------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
the GNU General Public License as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
|
||||
|
||||
|
||||
//=================
|
||||
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
|
||||
//====================================================================
|
||||
function lookup_Nikon_tag($tag,$model) {
|
||||
|
||||
if($model==0) {
|
||||
switch($tag) {
|
||||
case "0003": $tag = "Quality";break;
|
||||
case "0004": $tag = "ColorMode";break;
|
||||
case "0005": $tag = "ImageAdjustment";break;
|
||||
case "0006": $tag = "CCDSensitivity";break;
|
||||
case "0007": $tag = "WhiteBalance";break;
|
||||
case "0008": $tag = "Focus";break;
|
||||
case "0009": $tag = "Unknown2";break;
|
||||
case "000a": $tag = "DigitalZoom";break;
|
||||
case "000b": $tag = gettext("Converter");break;
|
||||
|
||||
default: $tag = "unknown:".$tag;break;
|
||||
}
|
||||
} else if($model==1) {
|
||||
switch($tag) {
|
||||
case "0002": $tag = "ISOSetting";break;
|
||||
case "0003": $tag = "ColorMode";break;
|
||||
case "0004": $tag = "Quality";break;
|
||||
case "0005": $tag = "Whitebalance";break;
|
||||
case "0006": $tag = "ImageSharpening";break;
|
||||
case "0007": $tag = "FocusMode";break;
|
||||
case "0008": $tag = "FlashSetting";break;
|
||||
case "0009": $tag = "FlashMode";break;
|
||||
case "000b": $tag = "WhiteBalanceFine";break;
|
||||
case "000c": $tag = "WB_RBLevels";break;
|
||||
case "000d": $tag = "ProgramShift";break;
|
||||
case "000e": $tag = "ExposureDifference";break;
|
||||
case "000f": $tag = "ISOSelection";break;
|
||||
case "0010": $tag = "DataDump";break;
|
||||
case "0011": $tag = "NikonPreview";break;
|
||||
case "0012": $tag = "FlashExposureComp";break;
|
||||
case "0013": $tag = "ISOSetting2";break;
|
||||
case "0014": $tag = "ColorBalanceA";break;
|
||||
case "0016": $tag = "ImageBoundary";break;
|
||||
case "0017": $tag = "FlashExposureComp";break;
|
||||
case "0018": $tag = "FlashExposureBracketValue";break;
|
||||
case "0019": $tag = "ExposureBracketValue";break;
|
||||
case "001a": $tag = "ImageProcessing";break;
|
||||
case "001b": $tag = "CropHiSpeed";break;
|
||||
case "001c": $tag = "ExposureTuning";break;
|
||||
case "001d": $tag = "SerialNumber";break;
|
||||
case "001e": $tag = "ColorSpace";break;
|
||||
case "001f": $tag = "VRInfo";break;
|
||||
case "0020": $tag = "ImageAuthentication";break;
|
||||
case "0022": $tag = "ActiveD-Lighting";break;
|
||||
case "0023": $tag = "PictureControl";break;
|
||||
case "0024": $tag = "WorldTime";break;
|
||||
case "0025": $tag = "ISOInfo";break;
|
||||
case "002a": $tag = "VignetteControl";break;
|
||||
case "002b": $tag = "DistortInfo";break;
|
||||
case "0080": $tag = "ImageAdjustment";break;
|
||||
case "0081": $tag = "ToneCompensation";break;
|
||||
case "0082": $tag = "Adapter";break;
|
||||
case "0083": $tag = "LensType";break;
|
||||
case "0084": $tag = "LensInfo";break;
|
||||
case "0085": $tag = "ManualFocusDistance";break;
|
||||
case "0086": $tag = "DigitalZoom";break;
|
||||
case "0087": $tag = "FlashUsed";break;
|
||||
case "0088": $tag = "AFFocusPosition";break;
|
||||
case "0089": $tag = "ShootingMode";break;
|
||||
case "008b": $tag = "LensFStops";break;
|
||||
case "008c": $tag = "ContrastCurve";break;
|
||||
case "008d": $tag = "ColorMode";break;
|
||||
case "0090": $tag = "LightType";break;
|
||||
case "0092": $tag = "HueAdjustment";break;
|
||||
case "0093": $tag = "NEFCompression";break;
|
||||
case "0094": $tag = "Saturation";break;
|
||||
case "0095": $tag = "NoiseReduction";break;
|
||||
case "009a": $tag = "SensorPixelSize";break;
|
||||
|
||||
default: $tag = "unknown:".$tag;break;
|
||||
}
|
||||
}
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
|
||||
//=================
|
||||
// Formats Data for the data type
|
||||
//====================================================================
|
||||
function formatNikonData($type,$tag,$intel,$model,$data) {
|
||||
switch ($type) {
|
||||
case "ASCII":
|
||||
break; // do nothing!
|
||||
case "URATIONAL":
|
||||
case"SRATIONAL":
|
||||
switch ($tag) {
|
||||
case '0084': // LensInfo
|
||||
$minFL = unRational(substr($data,0,8),$type,$intel);
|
||||
$maxFL = unRational(substr($data,8,8),$type,$intel);
|
||||
$minSP = unRational(substr($data,16,8),$type,$intel);
|
||||
$maxSP = unRational(substr($data,24,8),$type,$intel);
|
||||
if ($minFL == $maxFL) {
|
||||
$data = sprintf('%0.0fmm f/%0.1f',$minFL,$minSP);
|
||||
} elseif ($minSP == $maxSP) {
|
||||
$data = sprintf('%0.0f-%0.0fmm f/%0.1f',$minFL,$maxFL,$minSP);
|
||||
} else {
|
||||
$data = sprintf('%0.0f-%0.0fmm f/%0.1f-%0.1f',$minFL,$maxFL,$minSP,$maxSP);
|
||||
}
|
||||
break;
|
||||
case "0085":
|
||||
if ($model==1) $data=unRational($data,$type,$intel)." m"; //ManualFocusDistance
|
||||
break;
|
||||
case "0086":
|
||||
if ($model==1) $data=unRational($data,$type,$intel)."x"; //DigitalZoom
|
||||
break;
|
||||
case "000a":
|
||||
if ($model==0) $data=unRational($data,$type,$intel)."x"; //DigitalZoom
|
||||
break;
|
||||
default:
|
||||
$data=unRational($data,$type,$intel);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "USHORT":
|
||||
case $type=="SSHORT":
|
||||
case $type=="ULONG":
|
||||
case $type=="SLONG":
|
||||
case $type=="FLOAT":
|
||||
case $type=="DOUBLE":
|
||||
$data = rational($data,$type,$intel);
|
||||
switch ($tag) {
|
||||
case "0003":
|
||||
if ($model==0) { //Quality
|
||||
switch ($data) {
|
||||
case 1: $data = gettext("VGA Basic"); break;
|
||||
case 2: $data = gettext("VGA Normal"); break;
|
||||
case 3: $data = gettext("VGA Fine"); break;
|
||||
case 4: $data = gettext("SXGA Basic"); break;
|
||||
case 5: $data = gettext("SXGA Normal"); break;
|
||||
case 6: $data = gettext("SXGA Fine"); break;
|
||||
default: $data = gettext("Unknown").": ".$data; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "0004":
|
||||
if ($model==0) { //Color
|
||||
switch ($data) {
|
||||
case 1: $data = gettext("Color"); break;
|
||||
case 2: $data = gettext("Monochrome"); break;
|
||||
default: $data = gettext("Unknown").": ".$data; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "0005":
|
||||
if ($model==0) { //Image Adjustment
|
||||
switch ($data) {
|
||||
case 0: $data = gettext("Normal"); break;
|
||||
case 1: $data = gettext("Bright+"); break;
|
||||
case 2: $data = gettext("Bright-"); break;
|
||||
case 3: $data = gettext("Contrast+"); break;
|
||||
case 4: $data = gettext("Contrast-"); break;
|
||||
default: $data = gettext("Unknown").": ".$data; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "0006":
|
||||
if ($model==0) { //CCD Sensitivity
|
||||
switch($data) {
|
||||
case 0: $data = "ISO-80"; break;
|
||||
case 2: $data = "ISO-160"; break;
|
||||
case 4: $data = "ISO-320"; break;
|
||||
case 5: $data = "ISO-100"; break;
|
||||
default: $data = gettext("Unknown").": ".$data; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "0007":
|
||||
if ($model==0) { //White Balance
|
||||
switch ($data) {
|
||||
case 0: $data = gettext("Auto"); break;
|
||||
case 1: $data = gettext("Preset"); break;
|
||||
case 2: $data = gettext("Daylight"); break;
|
||||
case 3: $data = gettext("Incandescence"); break;
|
||||
case 4: $data = gettext("Fluorescence"); break;
|
||||
case 5: $data = gettext("Cloudy"); break;
|
||||
case 6: $data = gettext("SpeedLight"); break;
|
||||
default: $data = gettext("Unknown").": ".$data; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "000b":
|
||||
if ($model==0) { //Converter
|
||||
switch ($data) {
|
||||
case 0: $data = gettext("None"); break;
|
||||
case 1: $data = gettext("Fisheye"); break;
|
||||
default: $data = gettext("Unknown").": ".$data; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "UNDEFINED":
|
||||
switch ($tag) {
|
||||
case "0001":
|
||||
if ($model==1) $data=$data/100; break; //Unknown (Version?)
|
||||
break;
|
||||
case "0088":
|
||||
if ($model==1) { //AF Focus Position
|
||||
$temp = gettext("Center");
|
||||
$data = bin2hex($data);
|
||||
$data = str_replace("01","Top",$data);
|
||||
$data = str_replace("02","Bottom",$data);
|
||||
$data = str_replace("03","Left",$data);
|
||||
$data = str_replace("04","Right",$data);
|
||||
$data = str_replace("00","",$data);
|
||||
if(strlen($data)==0) $data = $temp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
switch ($tag) {
|
||||
case "0083":
|
||||
if ($model==1) { //Lens Type
|
||||
$data = hexdec(substr($data,0,2));
|
||||
switch ($data) {
|
||||
case 0: $data = gettext("AF non D"); break;
|
||||
case 1: $data = gettext("Manual"); break;
|
||||
case 2: $data = "AF-D or AF-S"; break;
|
||||
case 6: $data = "AF-D G"; break;
|
||||
case 10: $data = "AF-D VR"; break;
|
||||
case 14: $data = "AF-D G VR"; break;
|
||||
default: $data = gettext("Unknown").": ".$data; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "0087":
|
||||
if ($model==1) { //Flash type
|
||||
$data = hexdec(substr($data,0,2));
|
||||
if($data == 0) $data = gettext("Did Not Fire");
|
||||
else if($data == 4) $data = gettext("Unknown");
|
||||
else if($data == 7) $data = gettext("External");
|
||||
else if($data == 9) $data = gettext("On Camera");
|
||||
else $data = gettext("Unknown").": ".$data;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
//=================
|
||||
// Nikon Special data section
|
||||
//====================================================================
|
||||
function parseNikon($block,&$result) {
|
||||
|
||||
if($result['Endien']=="Intel") $intel=1;
|
||||
else $intel=0;
|
||||
|
||||
$model = $result['IFD0']['Model'];
|
||||
|
||||
//these 6 models start with "Nikon". Other models dont.
|
||||
if($model=="E700\0" || $model=="E800\0" || $model=="E900\0" || $model=="E900S\0" || $model=="E910\0" || $model=="E950\0") {
|
||||
$place=8; //current place
|
||||
$model = 0;
|
||||
|
||||
//Get number of tags (2 bytes)
|
||||
$num = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $num = intel2Moto($num);
|
||||
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
|
||||
|
||||
//loop thru all tags Each field is 12 bytes
|
||||
for($i=0;$i<hexdec($num);$i++) {
|
||||
//2 byte tag
|
||||
$tag = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $tag = intel2Moto($tag);
|
||||
$tag_name = lookup_Nikon_tag($tag, $model);
|
||||
|
||||
//2 byte type
|
||||
$type = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $type = intel2Moto($type);
|
||||
lookup_type($type,$size);
|
||||
|
||||
//4 byte count of number of data units
|
||||
$count = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $count = intel2Moto($count);
|
||||
$bytesofdata = validSize($size*hexdec($count));
|
||||
|
||||
//4 byte value of data or pointer to data
|
||||
$value = substr($block,$place,4);$place+=4;
|
||||
|
||||
//if tag is 0002 then its the ASCII value which we know is at 140 so calc offset
|
||||
//THIS HACK ONLY WORKS WITH EARLY NIKON MODELS
|
||||
if($tag=="0002") $offset = hexdec($value)-140;
|
||||
if($bytesofdata<=4) {
|
||||
$data = substr($value,0,$bytesofdata);
|
||||
} else {
|
||||
$value = bin2hex($value);
|
||||
if($intel==1) $value = intel2Moto($value);
|
||||
$data = substr($block,hexdec($value)-$offset,$bytesofdata*2);
|
||||
}
|
||||
$formated_data = formatNikonData($type,$tag,$intel,$model,$data);
|
||||
|
||||
if($result['VerboseOutput']==1) {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
|
||||
} else {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$place=0;//current place
|
||||
$model = 1;
|
||||
|
||||
$nikon = substr($block,$place,8);$place+=8;
|
||||
$endien = substr($block,$place,4);$place+=4;
|
||||
|
||||
//2 bytes of 0x002a
|
||||
$tag = bin2hex(substr($block,$place,2));$place+=2;
|
||||
|
||||
//Then 4 bytes of offset to IFD0 (usually 8 which includes all 8 bytes of TIFF header)
|
||||
$offset = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $offset = intel2Moto($offset);
|
||||
if(hexdec($offset)>8) $place+=$offset-8;
|
||||
|
||||
//Get number of tags (2 bytes)
|
||||
$num = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $num = intel2Moto($num);
|
||||
|
||||
//loop thru all tags Each field is 12 bytes
|
||||
for($i=0;$i<hexdec($num);$i++) {
|
||||
//2 byte tag
|
||||
$tag = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $tag = intel2Moto($tag);
|
||||
$tag_name = lookup_Nikon_tag($tag, $model);
|
||||
|
||||
//2 byte type
|
||||
$type = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $type = intel2Moto($type);
|
||||
lookup_type($type,$size);
|
||||
|
||||
//4 byte count of number of data units
|
||||
$count = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $count = intel2Moto($count);
|
||||
$bytesofdata = validSize($size*hexdec($count));
|
||||
|
||||
//4 byte value of data or pointer to data
|
||||
$value = substr($block,$place,4);$place+=4;
|
||||
|
||||
if($bytesofdata<=4) {
|
||||
$data = substr($value,0,$bytesofdata);
|
||||
} else {
|
||||
$value = bin2hex($value);
|
||||
if($intel==1) $value = intel2Moto($value);
|
||||
$data = substr($block,hexdec($value)+hexdec($offset)+2,$bytesofdata);
|
||||
}
|
||||
$formated_data = formatNikonData($type,$tag,$intel,$model,$data);
|
||||
|
||||
if($result['VerboseOutput']==1) {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
|
||||
} else {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
189
-child/exifer/makers/olympus.php
Executable file
@@ -0,0 +1,189 @@
|
||||
<?php //================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
/*
|
||||
Exifer
|
||||
Extracts EXIF information from digital photos.
|
||||
|
||||
Copyright <20> 2003 Jake Olefsky
|
||||
http://www.offsky.com/software/exif/index.php
|
||||
jake@olefsky.com
|
||||
|
||||
Please see exif.php for the complete information about this software.
|
||||
|
||||
------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
the GNU General Public License as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
|
||||
|
||||
|
||||
//=================
|
||||
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
|
||||
//====================================================================
|
||||
function lookup_Olympus_tag($tag) {
|
||||
switch($tag) {
|
||||
case "0200": $tag = "SpecialMode";break;
|
||||
case "0201": $tag = "JpegQual";break;
|
||||
case "0202": $tag = "Macro";break;
|
||||
case "0203": $tag = "Unknown1";break;
|
||||
case "0204": $tag = "DigiZoom";break;
|
||||
case "0205": $tag = "Unknown2";break;
|
||||
case "0206": $tag = "Unknown3";break;
|
||||
case "0207": $tag = "SoftwareRelease";break;
|
||||
case "0208": $tag = "PictInfo";break;
|
||||
case "0209": $tag = "CameraID";break;
|
||||
case "0f00": $tag = "DataDump";break;
|
||||
|
||||
default: $tag = "unknown:".$tag;break;
|
||||
}
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
//=================
|
||||
// Formats Data for the data type
|
||||
//====================================================================
|
||||
function formatOlympusData($type,$tag,$intel,$data) {
|
||||
if($type=="ASCII") {
|
||||
|
||||
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
|
||||
$data = unRational($data,$type,$intel);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
|
||||
if($tag=="0204") { //DigitalZoom
|
||||
$data=$data."x";
|
||||
}
|
||||
if($tag=="0205") { //Unknown2
|
||||
|
||||
}
|
||||
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = rational($data,$type,$intel);
|
||||
|
||||
if($tag=="0201") { //JPEGQuality
|
||||
if($data == 1) $data = "SQ";
|
||||
else if($data == 2) $data = "HQ";
|
||||
else if($data == 3) $data = "SHQ";
|
||||
else $data = gettext("Unknown").": ".$data;
|
||||
}
|
||||
if($tag=="0202") { //Macro
|
||||
if($data == 0) $data = "Normal";
|
||||
else if($data == 1) $data = "Macro";
|
||||
else $data = gettext("Unknown").": ".$data;
|
||||
}
|
||||
} else if($type=="UNDEFINED") {
|
||||
|
||||
} else {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//==============================================================================
|
||||
// Olympus Special data section
|
||||
// - Updated by Zenphoto for new header tag in E-410/E-510/E-3 cameras. 2/24/2008
|
||||
//==============================================================================
|
||||
function parseOlympus($block, &$result, $seek, $globalOffset) {
|
||||
|
||||
if($result['Endien']=="Intel") $intel = 1;
|
||||
else $intel = 0;
|
||||
|
||||
$model = $result['IFD0']['Model'];
|
||||
|
||||
// New header for new DSLRs - Check for it because the
|
||||
// number of bytes that count the IFD fields differ in each case.
|
||||
// Fixed by Zenphoto 2/24/08
|
||||
$new = false;
|
||||
if (substr($block, 0, 8) == "OLYMPUS\x00") {
|
||||
$new = true;
|
||||
} else if (substr($block, 0, 7) == "OLYMP\x00\x01"
|
||||
|| substr($block, 0, 7) == "OLYMP\x00\x02") {
|
||||
$new = false;
|
||||
} else {
|
||||
// Header does not match known Olympus headers.
|
||||
// This is not a valid OLYMPUS Makernote.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Offset of IFD entry after Olympus header.
|
||||
$place = 8;
|
||||
$offset = 8;
|
||||
|
||||
// Get number of tags (1 or 2 bytes, depending on New or Old makernote)
|
||||
$countfieldbits = $new ? 1 : 2;
|
||||
// New makernote repeats 1-byte value twice, so increment $place by 2 in either case.
|
||||
$num = bin2hex(substr($block, $place, $countfieldbits)); $place += 2;
|
||||
if ($intel == 1) $num = intel2Moto($num);
|
||||
$ntags = hexdec($num);
|
||||
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = $ntags;
|
||||
|
||||
//loop thru all tags Each field is 12 bytes
|
||||
for($i=0; $i < $ntags; $i++) {
|
||||
//2 byte tag
|
||||
$tag = bin2hex(substr($block, $place,2));
|
||||
$place += 2;
|
||||
if ($intel == 1) $tag = intel2Moto($tag);
|
||||
$tag_name = lookup_Olympus_tag($tag);
|
||||
|
||||
//2 byte type
|
||||
$type = bin2hex(substr($block, $place,2));
|
||||
$place += 2;
|
||||
if ($intel == 1) $type = intel2Moto($type);
|
||||
lookup_type($type,$size);
|
||||
|
||||
//4 byte count of number of data units
|
||||
$count = bin2hex(substr($block, $place,4));
|
||||
$place+=4;
|
||||
if ($intel == 1) $count = intel2Moto($count);
|
||||
$bytesofdata = $size * hexdec($count);
|
||||
|
||||
//4 byte value of data or pointer to data
|
||||
$value = substr($block, $place,4);
|
||||
$place += 4;
|
||||
|
||||
|
||||
if ($bytesofdata <= 4) {
|
||||
$data = substr($value,0,$bytesofdata);
|
||||
} else {
|
||||
$value = bin2hex($value);
|
||||
if($intel==1) $value = intel2Moto($value);
|
||||
$v = fseek($seek,$globalOffset+hexdec($value)); //offsets are from TIFF header which is 12 bytes from the start of the file
|
||||
if(isset($GLOBALS['exiferFileSize']) && $v == 0 && $bytesofdata < $GLOBALS['exiferFileSize']) {
|
||||
$data = fread($seek, $bytesofdata);
|
||||
} else {
|
||||
$result['Errors'] = $result['Errors']++;
|
||||
$data = '';
|
||||
}
|
||||
}
|
||||
$formated_data = formatOlympusData($type,$tag,$intel,$data);
|
||||
|
||||
if($result['VerboseOutput']==1) {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
|
||||
} else {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
292
-child/exifer/makers/panasonic.php
Executable file
@@ -0,0 +1,292 @@
|
||||
<?php
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
/*
|
||||
Exifer
|
||||
Extracts EXIF information from digital photos.
|
||||
|
||||
Copyright <20> 2003 Jake Olefsky
|
||||
http://www.offsky.com/software/exif/index.php
|
||||
jake@olefsky.com
|
||||
|
||||
Please see exif.php for the complete information about this software.
|
||||
|
||||
------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
the GNU General Public License as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
|
||||
|
||||
//=================
|
||||
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
|
||||
//====================================================================
|
||||
function lookup_Panasonic_tag($tag) {
|
||||
|
||||
switch($tag) {
|
||||
case "0001": $tag = "Quality";break;
|
||||
case "0002": $tag = "FirmwareVersion";break;
|
||||
case "0003": $tag = "WhiteBalance";break;
|
||||
case "0007": $tag = "FocusMode";break;
|
||||
case "000f": $tag = "AFMode";break;
|
||||
case "001a": $tag = "ImageStabilizer";break;
|
||||
case "001c": $tag = "MacroMode";break;
|
||||
case "001f": $tag = "ShootingMode";break;
|
||||
case "0020": $tag = "Audio";break;
|
||||
case "0021": $tag = "DataDump";break;
|
||||
case "0023": $tag = "WhiteBalanceBias";break;
|
||||
case "0024": $tag = "FlashBias";break;
|
||||
case "0025": $tag = "SerialNumber";break;
|
||||
case "0028": $tag = "ColourEffect";break;
|
||||
case "002a": $tag = "BurstMode";break;
|
||||
case "002b": $tag = "SequenceNumber";break;
|
||||
case "002c": $tag = "Contrast";break;
|
||||
case "002d": $tag = "NoiseReduction";break;
|
||||
case "002e": $tag = "SelfTimer";break;
|
||||
case "0030": $tag = "Rotation";break;
|
||||
case "0032": $tag = "ColorMode";break;
|
||||
case "0036": $tag = "TravelDay";break;
|
||||
|
||||
default: $tag = "unknown:".$tag;break;
|
||||
}
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
//=================
|
||||
// Formats Data for the data type
|
||||
//====================================================================
|
||||
function formatPanasonicData($type,$tag,$intel,$data) {
|
||||
|
||||
if($type=="ASCII") {
|
||||
|
||||
} else if($type=="UBYTE" || $type=="SBYTE") {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
$data=hexdec($data);
|
||||
|
||||
if($tag=="000f") { //AFMode
|
||||
if($data == 256) $data = "9-area-focusing";
|
||||
else if($data == 16) $data = "1-area-focusing";
|
||||
else if($data == 4096) $data = gettext("3-area-focusing (High speed)");
|
||||
else if($data == 4112) $data = gettext("1-area-focusing (High speed)");
|
||||
else if($data == 16) $data = gettext("1-area-focusing");
|
||||
else if($data == 1) $data = gettext("Spot-focusing");
|
||||
else $data = "Unknown (".$data.")";
|
||||
}
|
||||
|
||||
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
|
||||
$data = unRational($data,$type,$intel);
|
||||
|
||||
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = rational($data,$type,$intel);
|
||||
|
||||
if($tag=="0001") { //Image Quality
|
||||
if($data == 2) $data = gettext("High");
|
||||
else if($data == 3) $data = gettext("Standard");
|
||||
else if($data == 6) $data = gettext("Very High");
|
||||
else if($data == 7) $data = gettext("RAW");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="0003") { //White Balance
|
||||
if($data == 1) $data = gettext("Auto");
|
||||
else if($data == 2) $data = gettext("Daylight");
|
||||
else if($data == 3) $data = gettext("Cloudy");
|
||||
else if($data == 4) $data = gettext("Halogen");
|
||||
else if($data == 5) $data = gettext("Manual");
|
||||
else if($data == 8) $data = gettext("Flash");
|
||||
else if($data == 10) $data = gettext("Black and White");
|
||||
else if($data == 11) $data = gettext("Manual");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="0007") { //Focus Mode
|
||||
if($data == 1) $data = gettext("Auto");
|
||||
else if($data == 2) $data = gettext("Manual");
|
||||
else if($data == 4) $data = gettext("Auto, Focus button");
|
||||
else if($data == 5) $data = gettext("Auto, Continuous");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="001a") { //Image Stabilizer
|
||||
if($data == 2) $data = gettext("Mode 1");
|
||||
else if($data == 3) $data = gettext("Off");
|
||||
else if($data == 4) $data = gettext("Mode 2");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="001c") { //Macro mode
|
||||
if($data == 1) $data = gettext("On");
|
||||
else if($data == 2) $data = gettext("Off");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="001f") { //Shooting Mode
|
||||
if($data == 1) $data = gettext("Normal");
|
||||
else if($data == 2) $data = gettext("Portrait");
|
||||
else if($data == 3) $data = gettext("Scenery");
|
||||
else if($data == 4) $data = gettext("Sports");
|
||||
else if($data == 5) $data = gettext("Night Portrait");
|
||||
else if($data == 6) $data = gettext("Program");
|
||||
else if($data == 7) $data = gettext("Aperture Priority");
|
||||
else if($data == 8) $data = gettext("Shutter Priority");
|
||||
else if($data == 9) $data = gettext("Macro");
|
||||
else if($data == 11) $data = gettext("Manual");
|
||||
else if($data == 13) $data = gettext("Panning");
|
||||
else if($data == 14) $data = gettext("Simple");
|
||||
else if($data == 18) $data = gettext("Fireworks");
|
||||
else if($data == 19) $data = gettext("Party");
|
||||
else if($data == 20) $data = gettext("Snow");
|
||||
else if($data == 21) $data = gettext("Night Scenery");
|
||||
else if($data == 22) $data = gettext("Food");
|
||||
else if($data == 23) $data = gettext("Baby");
|
||||
else if($data == 27) $data = gettext("High Sensitivity");
|
||||
else if($data == 29) $data = gettext("Underwater");
|
||||
else if($data == 33) $data = gettext("Pet");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="0020") { //Audio
|
||||
if($data == 1) $data = gettext("Yes");
|
||||
else if($data == 2) $data = gettext("No");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="0023") { //White Balance Bias
|
||||
$data=$data." EV";
|
||||
}
|
||||
if($tag=="0024") { //Flash Bias
|
||||
$data = $data;
|
||||
}
|
||||
if($tag=="0028") { //Colour Effect
|
||||
if($data == 1) $data = gettext("Off");
|
||||
else if($data == 2) $data = gettext("Warm");
|
||||
else if($data == 3) $data = gettext("Cool");
|
||||
else if($data == 4) $data = gettext("Black and White");
|
||||
else if($data == 5) $data = gettext("Sepia");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="002a") { //Burst Mode
|
||||
if($data == 0) $data = gettext("Off");
|
||||
else if($data == 1) $data = gettext("Low/High Quality");
|
||||
else if($data == 2) $data = gettext("Infinite");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="002c") { //Contrast
|
||||
if($data == 0) $data = gettext("Standard");
|
||||
else if($data == 1) $data = gettext("Low");
|
||||
else if($data == 2) $data = gettext("High");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="002d") { //Noise Reduction
|
||||
if($data == 0) $data = gettext("Standard");
|
||||
else if($data == 1) $data = gettext("Low");
|
||||
else if($data == 2) $data = gettext("High");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="002e") { //Self Timer
|
||||
if($data == 1) $data = gettext("Off");
|
||||
else if($data == 2) $data = gettext("10s");
|
||||
else if($data == 3) $data = gettext("2s");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="0030") { //Rotation
|
||||
if($data == 1) $data = gettext("Horizontal (normal)");
|
||||
else if($data == 6) $data = gettext("Rotate 90 CW");
|
||||
else if($data == 8) $data = gettext("Rotate 270 CW");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="0032") { //Color Mode
|
||||
if($data == 0) $data = gettext("Normal");
|
||||
else if($data == 1) $data = gettext("Natural");
|
||||
else $data = gettext("Unknown")." (".$data.")";
|
||||
}
|
||||
if($tag=="0036") { //Travel Day
|
||||
$data=$data;
|
||||
}
|
||||
} else if($type=="UNDEFINED") {
|
||||
|
||||
} else {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=================
|
||||
// Panasonic Special data section
|
||||
//====================================================================
|
||||
function parsePanasonic($block,&$result) {
|
||||
|
||||
//if($result['Endien']=="Intel") $intel=1;
|
||||
//else $intel=0;
|
||||
$intel=1;
|
||||
|
||||
$model = $result['IFD0']['Model'];
|
||||
|
||||
$place=8; //current place
|
||||
$offset=8;
|
||||
|
||||
|
||||
$num = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $num = intel2Moto($num);
|
||||
$result['SubIFD']['MakerNote']['Offset'] = hexdec($num);
|
||||
|
||||
//Get number of tags (2 bytes)
|
||||
$num = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $num = intel2Moto($num);
|
||||
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
|
||||
|
||||
//loop thru all tags Each field is 12 bytes
|
||||
for($i=0;$i<hexdec($num);$i++) {
|
||||
|
||||
//2 byte tag
|
||||
$tag = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $tag = intel2Moto($tag);
|
||||
$tag_name = lookup_Panasonic_tag($tag);
|
||||
|
||||
//2 byte type
|
||||
$type = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $type = intel2Moto($type);
|
||||
lookup_type($type,$size);
|
||||
|
||||
//4 byte count of number of data units
|
||||
$count = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $count = intel2Moto($count);
|
||||
$bytesofdata = validSize($size*hexdec($count));
|
||||
|
||||
//4 byte value of data or pointer to data
|
||||
$value = substr($block,$place,4);$place+=4;
|
||||
|
||||
|
||||
if($bytesofdata<=4) {
|
||||
$data = substr($value,0,$bytesofdata);
|
||||
} else {
|
||||
$value = bin2hex($value);
|
||||
if($intel==1) $value = intel2Moto($value);
|
||||
$data = substr($block,hexdec($value)-$offset,$bytesofdata*2);
|
||||
}
|
||||
$formated_data = formatPanasonicData($type,$tag,$intel,$data);
|
||||
|
||||
if($result['VerboseOutput']==1) {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
|
||||
} else {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
157
-child/exifer/makers/sanyo.php
Executable file
@@ -0,0 +1,157 @@
|
||||
<?php //================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
/*
|
||||
Exifer
|
||||
Extracts EXIF information from digital photos.
|
||||
|
||||
Copyright <20> 2003 Jake Olefsky
|
||||
http://www.offsky.com/software/exif/index.php
|
||||
jake@olefsky.com
|
||||
|
||||
Please see exif.php for the complete information about this software.
|
||||
|
||||
------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
the GNU General Public License as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
//================================================================================================
|
||||
|
||||
|
||||
|
||||
//=================
|
||||
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
|
||||
//====================================================================
|
||||
function lookup_Sanyo_tag($tag) {
|
||||
|
||||
switch($tag) {
|
||||
case "0200": $tag = "SpecialMode";break;
|
||||
case "0201": $tag = "Quality";break;
|
||||
case "0202": $tag = "Macro";break;
|
||||
case "0203": $tag = "Unknown";break;
|
||||
case "0204": $tag = "DigiZoom";break;
|
||||
case "0f00": $tag = "DataDump";break;
|
||||
default: $tag = "unknown:".$tag;break;
|
||||
}
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
//=================
|
||||
// Formats Data for the data type
|
||||
//====================================================================
|
||||
function formatSanyoData($type,$tag,$intel,$data) {
|
||||
|
||||
if($type=="ASCII") {
|
||||
|
||||
|
||||
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
|
||||
$data = unRational($data,$type,$intel);
|
||||
|
||||
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = rational($data,$type,$intel);
|
||||
|
||||
if($tag=="0200") { //SpecialMode
|
||||
if($data == 0) $data = gettext("Normal");
|
||||
else $data = gettext("Unknown").": ".$data;
|
||||
}
|
||||
if($tag=="0201") { //Quality
|
||||
if($data == 2) $data = gettext("High");
|
||||
else $data = gettext("Unknown").": ".$data;
|
||||
}
|
||||
if($tag=="0202") { //Macro
|
||||
if($data == 0) $data = gettext("Normal");
|
||||
else $data = gettext("Unknown").": ".$data;
|
||||
}
|
||||
} else if($type=="UNDEFINED") {
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=================
|
||||
// Sanyo Special data section
|
||||
//====================================================================
|
||||
function parseSanyo($block,&$result,$seek, $globalOffset) {
|
||||
|
||||
if($result['Endien']=="Intel") $intel=1;
|
||||
else $intel=0;
|
||||
|
||||
$model = $result['IFD0']['Model'];
|
||||
|
||||
$place=8; //current place
|
||||
$offset=8;
|
||||
|
||||
//Get number of tags (2 bytes)
|
||||
$num = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $num = intel2Moto($num);
|
||||
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
|
||||
|
||||
//loop thru all tags Each field is 12 bytes
|
||||
for($i=0;$i<hexdec($num);$i++) {
|
||||
|
||||
//2 byte tag
|
||||
$tag = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $tag = intel2Moto($tag);
|
||||
$tag_name = lookup_Sanyo_tag($tag);
|
||||
|
||||
//2 byte type
|
||||
$type = bin2hex(substr($block,$place,2));$place+=2;
|
||||
if($intel==1) $type = intel2Moto($type);
|
||||
lookup_type($type,$size);
|
||||
|
||||
//4 byte count of number of data units
|
||||
$count = bin2hex(substr($block,$place,4));$place+=4;
|
||||
if($intel==1) $count = intel2Moto($count);
|
||||
$bytesofdata = validSize($size*hexdec($count));
|
||||
//4 byte value of data or pointer to data
|
||||
$value = substr($block,$place,4);$place+=4;
|
||||
|
||||
|
||||
if($bytesofdata<=4) {
|
||||
$data = substr($value,0,$bytesofdata);
|
||||
} else {
|
||||
$value = bin2hex($value);
|
||||
if($intel==1) $value = intel2Moto($value);
|
||||
$v = fseek($seek,$globalOffset+hexdec($value)); //offsets are from TIFF header which is 12 bytes from the start of the file
|
||||
if($tag!=0) {
|
||||
$data = fread($seek, $bytesofdata);
|
||||
} else if($v==-1) {
|
||||
$result['Errors'] = $result['Errors']++;
|
||||
}
|
||||
}
|
||||
$formated_data = formatSanyoData($type,$tag,$intel,$data);
|
||||
|
||||
if($result['VerboseOutput']==1) {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
|
||||
$data = bin2hex($data);
|
||||
if($intel==1) $data = intel2Moto($data);
|
||||
}
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
|
||||
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
|
||||
} else {
|
||||
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
12
-child/searchform.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<form role="search" method="get" class="searchform group" action="<?php echo home_url( '/' ); ?>">
|
||||
<label>
|
||||
<span class="offscreen"><?php //echo _x( 'Search for:', 'label' ) ?></span>
|
||||
<input type="search" class="search-field"
|
||||
placeholder="<?php echo esc_attr_x( 'Search', 'placeholder' ) ?>"
|
||||
value="<?php echo get_search_query() ?>" name="s"
|
||||
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
|
||||
</label>
|
||||
<input type="image" alt="Submit search query"
|
||||
src="data:image/svg+xml;base64,CjxzdmcgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTAwMCAxMDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPG1ldGFkYXRhPiBTdmcgVmVjdG9yIEljb25zIDogaHR0cDovL3d3dy5vbmxpbmV3ZWJmb250cy5jb20vaWNvbiA8L21ldGFkYXRhPgogIDxnPjxnPjxnIGlkPSJTZWFyY2hfMV8iPjxnPjxwYXRoIGQ9Ik05NjcuOSw4NjEuMmwtMTc3LjEtMTc3YzQ4LjUtNjkuNiw3Ny4yLTE1NCw3Ny4yLTI0NS4yYzAtMjM3LTE5Mi4xLTQyOS00MjktNDI5Yy0yMzcsMC00MjksMTkyLjEtNDI5LDQyOXMxOTIuMSw0MjksNDI5LDQyOWM5MS4yLDAsMTc1LjYtMjguNywyNDUuMi03Ny4ybDE3NywxNzdjMjkuNSwyOS41LDc3LjIsMjkuNSwxMDYuNywwQzk5Ny40LDkzOC41LDk5Ny40LDg5MC43LDk2Ny45LDg2MS4yeiBNNDM5LDc0NS41Yy0xNjkuMiwwLTMwNi41LTEzNy4yLTMwNi41LTMwNi41YzAtMTY5LjIsMTM3LjItMzA2LjUsMzA2LjUtMzA2LjVjMTY5LjIsMCwzMDYuNSwxMzcuMiwzMDYuNSwzMDYuNUM3NDUuNSw2MDguMyw2MDguMyw3NDUuNSw0MzksNzQ1LjV6IiBzdHlsZT0iZmlsbDojYTliN2I3Ij48L3BhdGg+PC9nPjwvZz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PC9nPjwvc3ZnPgogIA==" width="16" height="16">
|
||||
</form>
|
||||
|
||||
5
.gitignore
vendored
@@ -1 +1,6 @@
|
||||
.DS_Store
|
||||
/.settings
|
||||
/.buildpath
|
||||
/.project
|
||||
/-child
|
||||
.vscode
|
||||
|
||||
350
ce-mois-bis.php
@@ -1,350 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: Ce-mois bis
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.0
|
||||
*/
|
||||
|
||||
|
||||
get_header();
|
||||
|
||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||
define('SERVERPATH',$root.'/zenphoto');
|
||||
include('../photoblog/exifer/exif.php');
|
||||
|
||||
//nb d'archive par page
|
||||
$nb = 12;
|
||||
global $ppage;
|
||||
|
||||
$url = $_SERVER[REDIRECT_URL];
|
||||
$a = explode("/", $url);
|
||||
$pages = end($a);
|
||||
$pages = prev($a);
|
||||
|
||||
if ($pages != get_page_uri()) $ppage = $pages;
|
||||
else $ppage = "1";
|
||||
|
||||
?>
|
||||
|
||||
<div class="content">
|
||||
<div class="container">
|
||||
<div class="post_content">
|
||||
<?php if(have_posts()): the_post(); ?>
|
||||
<article class="post_box" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1><?php the_title(); ?></h1>
|
||||
<?php the_content(); ?>
|
||||
</article>
|
||||
|
||||
<?php
|
||||
$mois = date('n');
|
||||
$an = date('Y');
|
||||
$image = $mois . '_' . $an . '.jpg';
|
||||
$annee = $an;
|
||||
|
||||
// nom des fichiers: 7_2009.jpg et non pas 07_2009.jpg
|
||||
|
||||
for ($i = 0; $i <= 11 ; $i++) {
|
||||
$a = ($mois - $i);
|
||||
if ($a < 1) {
|
||||
$a = (12 + $a);
|
||||
$annee = $an - 1;
|
||||
}
|
||||
$tableau[$i] = $a . '_' . $annee . '.jpg';
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
while ($i < 13) {
|
||||
$file = '../zenphoto/albums/photos-du-mois/' . $tableau[$i];
|
||||
//echo $file;
|
||||
|
||||
if (file_exists($file)) {
|
||||
$photo_du_mois = $file;
|
||||
$title = $tableau[$i];
|
||||
|
||||
$size = getimagesize($photo_du_mois, $info);
|
||||
//preprint($size);
|
||||
|
||||
if ($size[0] > 1000) {
|
||||
// HD
|
||||
$hd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_FULL_watermark.jpg";
|
||||
if (file_exists($hd)) {
|
||||
$size_hd = getimagesize($hd, $info_hd);
|
||||
$imgs['img_hd'] = array(
|
||||
'url' => $hd,
|
||||
'width' => $size_hd[0],
|
||||
'height' => $size_hd[1]
|
||||
);
|
||||
}
|
||||
else {
|
||||
$imgs['img_hd'] = array(
|
||||
'url' => '../' . $photo_du_mois,
|
||||
'width' => $size[0],
|
||||
'height' => $size[1]
|
||||
);
|
||||
}
|
||||
// SD
|
||||
$sd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_800_watermark.jpg";
|
||||
if (file_exists($sd)) {
|
||||
$size_sd = getimagesize($sd, $info_sd);
|
||||
$imgs['img_sd'] = array(
|
||||
'url' => $sd,
|
||||
'width' => $size_sd[0],
|
||||
'height' => $size_sd[1]
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// SD
|
||||
$sd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_800_watermark.jpg";
|
||||
if (file_exists($sd)) {
|
||||
$size_sd = getimagesize($sd, $info_sd);
|
||||
$imgs['img_sd'] = array(
|
||||
'url' => $sd,
|
||||
'width' => $size_sd[0],
|
||||
'height' => $size_sd[1]
|
||||
);
|
||||
}
|
||||
$imgs['img_hd'] = array(
|
||||
'url' => "",
|
||||
'width' => "",
|
||||
'height' => ""
|
||||
);
|
||||
} // if ($size[0] > 1000)
|
||||
|
||||
$title = explode('.',$title);
|
||||
$title = explode('_',$title[0]);
|
||||
$title = mois2($title[0]) . ' ' . $title[1];
|
||||
$imgs['img_sd']['title'] = $title;
|
||||
|
||||
if (isset($info["APP13"])) {
|
||||
$iptc = iptcparse($info["APP13"]);
|
||||
|
||||
if (isset($iptc['2#120'][0])) $legende = $iptc['2#120'][0];
|
||||
else $legende = "";
|
||||
if (isset($iptc['2#005'][0])) $titre = $iptc['2#005'][0];
|
||||
else $titre = "";
|
||||
|
||||
$keyword = "";
|
||||
if (isset($iptc['2#025'])) {
|
||||
foreach ($iptc['2#025'] as $key => $val) {
|
||||
$keyword .= '<a href="' . $host . '/zenphoto/index.php?p=search&words=' . $val . '" title="Tag > ' . $val . '" rel="tag">' . $val . '</a>';
|
||||
$keyword .= ', ';
|
||||
}
|
||||
$keyword = substr($keyword, 0, -2);
|
||||
}
|
||||
|
||||
$imgs['img_sd']['legende'] = $legende;
|
||||
$imgs['img_sd']['titre'] = $titre;
|
||||
$imgs['img_sd']['keyword'] = $keyword;
|
||||
}
|
||||
|
||||
$exifInfo = "";
|
||||
$exif_array = read_exif_data_raw($file,0);
|
||||
$exifInfo = __('The','CreatorThemeRes-child') . " " .date(__("F j, Y, g:i a",'CreatorThemeRes-child'),strtotime($exif_array['SubIFD']['DateTimeOriginal'])).' - ';
|
||||
$exifInfo .= $exif_array['SubIFD']['ExposureTime']. __(' at ','CreatorThemeRes-child') .$exif_array['SubIFD']['FNumber'].' - ' .$exif_array['SubIFD']['ISOSpeedRatings'].' ISO - '. __('Focal','CreatorThemeRes-child') .$exif_array['SubIFD']['FocalLength'];
|
||||
$imgs['img_sd']['exif'] = $exifInfo;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
//preprint($imgs);
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($ppage == "1") { ?>
|
||||
|
||||
<div class="cadre">
|
||||
|
||||
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
|
||||
<p class="titrePhoto"><?php echo $imgs['img_sd']['titre']; ?>Titre</p>
|
||||
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
|
||||
<?php } ?>
|
||||
|
||||
<!--img src="watermark2.php?src=<?php echo $photo_du_mois; ?>" alt="Image du mois" title="<?php echo $title; ?>" <?php echo $size[3]; ?> /-->
|
||||
|
||||
<!-- Retina -->
|
||||
<?php
|
||||
if (($imgs['img_sd']['url'] != "") && ($imgs['img_hd']['url'] != "")) {
|
||||
$standard_source = $imgs['img_sd']['url'] . ', ' . $imgs['img_hd']['url'] . ' 2x';
|
||||
//echo "1";
|
||||
}
|
||||
else if ($imgs['img_sd']['url'] != "") {
|
||||
$standard_source = $imgs['img_sd']['url'];
|
||||
//echo "2";
|
||||
}
|
||||
else if ($imgs['img_hd']['url'] != "") {
|
||||
$standard_source = $imgs['img_hd']['url'] . ' 2x';
|
||||
//echo "3";
|
||||
}
|
||||
//echo $standard_source;
|
||||
?>
|
||||
|
||||
<picture data-picture data-alt="">
|
||||
<!--[if IE 9]><video style="display: none;"><![endif]-->
|
||||
<source class="image_standard" srcset="<?php echo $standard_source; ?>">
|
||||
<!--source class="image_medium" srcset="" media="(max-width: 767px)">
|
||||
<source class="image_small" srcset="" media="(max-width: 767px)"-->
|
||||
<!--[if IE 9]></video><![endif]-->
|
||||
<?php
|
||||
echo '<img srcset="' . $imgs['img_sd']['url'] . '" alt="" width="'. $imgs['img_sd']['width'] . '" height="'. $imgs['img_sd']['height'] .'" />';
|
||||
?>
|
||||
</picture>
|
||||
|
||||
<!-- /Retina -->
|
||||
|
||||
</div><!-- /cadre -->
|
||||
|
||||
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
|
||||
<p class="titrePhoto"><?php echo $imgs['img_sd']['titre']; ?>Titre</p>
|
||||
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
|
||||
<?php } ?>
|
||||
|
||||
<p class="exifs"><?php echo $imgs['img_sd']['exif']; ?></p>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php');
|
||||
|
||||
$album = 'photos-du-mois'; //Photos du mois
|
||||
$table = array();
|
||||
if ($_SERVER['HTTP_HOST'] == "macbook-pro.local") {
|
||||
$table['images'] = ".images";
|
||||
$table['albums'] = ".albums";
|
||||
}
|
||||
/*
|
||||
if ($_SERVER['HTTP_HOST'] == "clicclac.info") {
|
||||
$table['images'] = "zp_images";
|
||||
$table['albums'] = "zp_albums";
|
||||
}
|
||||
*/
|
||||
if ($_SERVER['HTTP_HOST'] == "clicclac.info") {
|
||||
$table['images'] = "zenphoto_images";
|
||||
$table['albums'] = "zenphoto_albums";
|
||||
}
|
||||
|
||||
// Récupérer l'ID de l'album 'photos-du-mois' ($id_album)
|
||||
$i = 0;
|
||||
$conn = new mysqli($dbhost, $dbuser, $dbpassword, $zptable);
|
||||
if ($conn->connect_error) {
|
||||
trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR);
|
||||
exit();
|
||||
}
|
||||
$conn->set_charset("utf8");
|
||||
|
||||
$excquery = "SELECT `id` FROM `" . $table['albums'] . "` WHERE `folder` = '" . $album . "'";
|
||||
|
||||
if ($result = $conn->query($excquery)) {
|
||||
$result->data_seek(0);
|
||||
$row = $result->fetch_row();
|
||||
$id_album = $row[0];
|
||||
$result->close();
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
|
||||
// Récupérer toutes les fichiers de l'album 'photos-du-mois' ($fichier[])
|
||||
|
||||
$conn = new mysqli($dbhost, $dbuser, $dbpassword, $zptable);
|
||||
if ($conn->connect_error) {
|
||||
trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR);
|
||||
exit();
|
||||
}
|
||||
$conn->set_charset("utf8");
|
||||
|
||||
$pictquery = "SELECT `filename` FROM `" . $table['images'] . "` WHERE `albumid` = ? ORDER BY `date` DESC";
|
||||
|
||||
$stmt = $conn->prepare($pictquery);
|
||||
//echo $pictquery;
|
||||
if($stmt === false) {
|
||||
trigger_error('Wrong SQL: ' . $pictquery . ' Error: ' . $conn->error, E_USER_ERROR);
|
||||
}
|
||||
else {
|
||||
$stmt->bind_param('i', $id_album);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($filename);
|
||||
while ($stmt->fetch()) {
|
||||
$fichier[] = $filename;
|
||||
$i++;
|
||||
//echo $filename;
|
||||
}
|
||||
}
|
||||
$stmt->close();
|
||||
|
||||
//
|
||||
?>
|
||||
|
||||
<?php
|
||||
$aide = "<span class='aide'> ? </span><b>Utilisation:</b> cliquer sur une vignette, puis....<br />";
|
||||
$aide .= " <b><i>-sur ordinateur:</i></b> naviguer avec les touches flèches droite et gauche, quitter avec ESC.<br />";
|
||||
$aide .= " <b><i>-sur tablettes et smartphones:</i></b> balayer l'écran avec un doigt vers la droite ou vers la gauche, ou naviguer avec les touches flèches droite et gauche. Cliquer sur la X pour quitter.";
|
||||
?>
|
||||
|
||||
<div id="archive">
|
||||
<p style="clear: both; "></p>
|
||||
<h4><?php echo gettext("Archives"); ?> (<abbr title="<?php echo $aide; ?>" rel="tooltip"> ? </abbr>)</h4>
|
||||
<!--h4><?php echo gettext("Archives"); ?> <span class='aide'><a href="#" title="<?php echo $aide; ?>" class="tooltip"><span title="<?php echo gettext("Help"); ?>">( ? )</span></a></span></h4-->
|
||||
|
||||
<?php
|
||||
$debut = (($ppage - 1) * $nb) +1; // page 1: 2, page 2: 14, page 3: 26
|
||||
$fin = ($debut + $nb) - 1;
|
||||
|
||||
for ($j=$debut; $j<=$fin; $j++) {
|
||||
|
||||
if ($j <= count($fichier)-1) echo displayRetina($fichier[$j],$album);
|
||||
if ($j+1 <= count($fichier)-1) echo displayRetina($fichier[$j+1],$album);
|
||||
if ($j+2 <= count($fichier)-1) echo displayRetina($fichier[$j+2],$album);
|
||||
|
||||
$j = $j + 2;
|
||||
}
|
||||
?>
|
||||
|
||||
<p style="clear: both; "></p>
|
||||
|
||||
|
||||
<div class="blog-pagination">
|
||||
|
||||
<?php
|
||||
/**/
|
||||
// calcul du nombre de pages (arrondi a l'entier superieur)
|
||||
$nbpages = ceil(count($fichier) / 12);
|
||||
$prec = $ppage - 1;
|
||||
$suiv = $ppage + 1;
|
||||
|
||||
if ($ppage >= 2) echo '<a class="prev page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$prec.'" title="'.gettext("Previous Page").'"> ← </a> ';
|
||||
|
||||
for ($i = 1; $i <= $nbpages; $i++) {
|
||||
if ($i != $ppage) {
|
||||
echo '<a class="page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$i.'" title="'.gettext("Page").' '.$i.'">'.$i.' </a> ';
|
||||
}
|
||||
else {
|
||||
echo "<span class='current page-numbers'>".$i."</span> ";
|
||||
}
|
||||
}
|
||||
|
||||
if ($page < $nbpages) echo '<a class="next page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$suiv.'" title="'.gettext("Next Page").'"> → </a> ';
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<?php if ( comments_open() || '0' != get_comments_number() ) : ?>
|
||||
<div class="home_blog_box">
|
||||
|
||||
</div>
|
||||
<?php endif;
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
get_footer( 'page' );
|
||||
?>
|
||||
BIN
css/images/border.png
Executable file
|
After Width: | Height: | Size: 76 B |
BIN
css/images/controls.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
css/images/loading.gif
Executable file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
css/images/loading_background.png
Executable file
|
After Width: | Height: | Size: 131 B |
BIN
css/images/overlay.png
Executable file
|
After Width: | Height: | Size: 115 B |
@@ -45,18 +45,18 @@
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//<?php echo $_SERVER[SERVER_NAME]; ?>/piwik/";
|
||||
var u="//<?php echo $_SERVER['SERVER_NAME']; ?>/piwik/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', 1]);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<noscript><p><img src="//<?php echo $_SERVER[SERVER_NAME]; ?>/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
|
||||
<noscript><p><img src="//<?php echo $_SERVER['SERVER_NAME']; ?>/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
|
||||
<!-- End Piwik Code -->
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB7cAx3NSH4dPM3Sx2oQeud7Zr-KaGXmLk&callback=initMap" type="text/javascript"></script>
|
||||
<!--script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB7cAx3NSH4dPM3Sx2oQeud7Zr-KaGXmLk&callback=initMap" type="text/javascript"></script-->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1683
functions.php
@@ -9,7 +9,7 @@
|
||||
<!-- featherlight -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$( "button" ).click(function() {
|
||||
$( "button#togle" ).click(function() {
|
||||
$( ".comments_cont" ).toggle( "slow");
|
||||
|
||||
var $sp = $(this).text().trim().split(" ");
|
||||
@@ -74,6 +74,7 @@
|
||||
<ul>
|
||||
<?php
|
||||
/* flick - 500px - 500px - facebook - mail - rss - twitter - youtube - vimeo */
|
||||
/* <a href="https://www.onlinewebfonts.com">oNline Web Fonts</a> */
|
||||
$socials_img = array('data:image/svg+xml;base64,CjxzdmcgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTAwMCAxMDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPG1ldGFkYXRhPiBTdmcgVmVjdG9yIEljb25zIDogaHR0cDovL3d3dy5vbmxpbmV3ZWJmb250cy5jb20vaWNvbiA8L21ldGFkYXRhPgogIDxnPjxwYXRoIGQ9Ik04MjYuNywxMEgxNzMuNEM4My41LDEwLDEwLDgzLjUsMTAsMTczLjR2NjUzLjNDMTAsOTE2LjYsODMuNSw5OTAsMTczLjQsOTkwaDY1My40Yzg5LjgsMCwxNjMuMy03My41LDE2My4zLTE2My40VjE3My40Qzk5MCw4My41LDkxNi41LDEwLDgyNi43LDEweiBNMjg1LjYsNjUzLjFjLTg0LjYsMC0xNTMuMS02OC42LTE1My4xLTE1My4xYzAtODQuNiw2OC42LTE1My4xLDE1My4xLTE1My4xYzg0LjYsMCwxNTMuMSw2OC42LDE1My4xLDE1My4xQzQzOC44LDU4NC42LDM3MC4yLDY1My4xLDI4NS42LDY1My4xeiBNNzE0LjQsNjUzLjFjLTg0LjYsMC0xNTMuMS02OC42LTE1My4xLTE1My4xYzAtODQuNiw2OC42LTE1My4xLDE1My4xLTE1My4xUzg2Ny41LDQxNS40LDg2Ny41LDUwMEM4NjcuNSw1ODQuNiw3OTksNjUzLjEsNzE0LjQsNjUzLjF6IiBzdHlsZT0iZmlsbDojYTliN2I3Ij48L3BhdGg+PC9nPjwvc3ZnPgogIA==',
|
||||
'data:image/svg+xml;base64,CjxzdmcgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTAwMCAxMDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPG1ldGFkYXRhPiBTdmcgVmVjdG9yIEljb25zIDogaHR0cDovL3d3dy5vbmxpbmV3ZWJmb250cy5jb20vaWNvbiA8L21ldGFkYXRhPgogIDxnPjxnPjxwYXRoIGQ9Ik04NzcuNSw4NTZsLTMuMywzLjNjLTQxLjIsNDEuNi04OC40LDczLjUtMTQxLjYsOTUuN2MtNTYuMSwyMy4zLTExMy45LDM1LTE3My40LDM1Yy02MC4yLDAtMTE3LjktMTEuNy0xNzMuNC0zNWMtNTQtMjMtMTAxLjItNTQuOS0xNDEuNi05NS43Yy00MS4yLTQwLjgtNzMuMS04Ny45LTk1LjctMTQxLjFjLTE1LjMtMzcuNi0yNS4yLTcyLTI5LjUtMTAzLjRjLTEuNS0xMC4yLDcuMy0xNi44LDI2LjMtMTkuN2MxOC42LTIuOSwyOC44LDAuNywzMC42LDEwLjljMC40LDAuNCwwLjUsMS4xLDAuNSwyLjJjNi42LDMyLjgsMTQuOSw2MS44LDI1LjIsODdjMTguMiw0NS4yLDQ1LjksODYuNCw4My4xLDEyMy42YzM1LjcsMzUuNyw3Ni45LDYzLjQsMTIzLjYsODMuMWM0OC4xLDIwLjQsOTguNCwzMC42LDE1MC45LDMwLjZjNTIuMSwwLDEwMi40LTEwLjIsMTUwLjktMzAuNmM0Ni43LTIwLjEsODcuNy00Ny44LDEyMy04My4xbDMuMy0zLjNjMy42LTMuNiw4LjItNC43LDEzLjctMy4zYzQuNCwxLjEsMTAuNCw1LjEsMTgsMTJDODgxLjQsODM3LjgsODg0LjUsODQ4LjQsODc3LjUsODU2TDg3Ny41LDg1NnogTTYxOS40LDUxOS43bC0zNi4xLDM2LjFsMzQuNSwzNC41YzcuNyw3LjcsNi40LDE2LjYtMy44LDI2LjhjLTYuMiw2LjItMTIsOS4zLTE3LjUsOS4zYy0zLjYsMC03LjEtMS44LTEwLjQtNS41bC0zMy45LTMzLjRsLTM2LjEsMzYuMWMtMS44LDEuOC00LjYsMi43LTguMiwyLjdjLTUuNSwwLTExLjEtMi45LTE3LTguOGwtMS4xLTEuMWMtNi42LTUuNS05LjgtMTAuOC05LjgtMTUuOWMwLTIuNiwxLjUtNS43LDQuNC05LjNsMzYuMS0zNS41bC0zNi4xLTM2LjFjLTUuOC01LjgtMy4zLTE0LDcuNy0yNC42YzYuNi02LjYsMTIuMi05LjgsMTctOS44YzIuMiwwLDQuNiwwLjksNy4xLDIuN2wzNS41LDM2LjFsMzUuNS0zNS41YzYuNi02LjIsMTUuMy0zLjgsMjYuMyw3LjFDNjIzLjIsNTA1LjUsNjI1LjMsNTEzLjUsNjE5LjQsNTE5LjdMNjE5LjQsNTE5Ljd6IE04NzcsNTUwLjljMCw0My04LjQsODQuNi0yNS4yLDEyNC43Yy0xNi40LDM4LjMtMzkuNCw3Mi4yLTY4LjksMTAxLjdjLTI5LjIsMjkuMi02My4zLDUyLjEtMTAyLjMsNjguOWMtMzksMTYuOC04MC42LDI1LjItMTI0LjcsMjUuMnMtODUuNy04LjQtMTI0LjctMjUuMmMtMzktMTYuOC03My4xLTM5LjctMTAyLjMtNjguOWMtMjkuOS0yOS45LTUyLjctNjMuOC02OC40LTEwMS43Yy01LjUtMTEuNy04LjItMTktOC4yLTIxLjloLTAuNWMtMy4zLTkuOCw0LjYtMTcuOSwyMy41LTI0LjFjMTguMi01LjgsMjkuMi0zLjYsMzIuOCw2LjZjMTMuNSwzNi4xLDMxLjIsNjYuNSw1Myw5MS4zaDAuNVY1NDFjMS4xLTQ5LjYsMTkuNy05MS45LDU1LjgtMTI2LjljMzguMy0zNy42LDg0LjQtNTYuMywxMzguNC01Ni4zYzUzLjYsMCw5OS40LDE4LjgsMTM3LjMsNTYuM2MzNy45LDM3LjYsNTYuOSw4Mi45LDU2LjksMTM2LjJjMCw1My42LTE5LjEsOTkuNC01Ny4xLDEzNy4zYy0zOC4xLDM3LjktODMuOCw1Ni45LTEzNyw1Ni45Yy0yMS4xLDAtNDEuNi0yLjktNjEuMy04LjhjLTEwLjItNC0xMi42LTE1LjEtNy4xLTMzLjRjNS44LTE4LjYsMTMuOS0yNi40LDI0LjEtMjMuNWw3LjcsMS42YzUuMSwxLjEsMTEsMi4yLDE3LjgsMy4zYzYuNywxLjEsMTIuMywxLjYsMTYuNywxLjZjMzcuOSwwLDcwLTEzLDk2LjMtMzkuMWMyNi4yLTI2LjEsMzkuNC01Ny45LDM5LjQtOTUuNGMwLTM2LjgtMTMuMS02OC0zOS40LTkzLjVjLTI1LjktMjUuOS01Ny44LTM4LjgtOTUuNy0zOC44Yy0zOSwwLTcxLjUsMTQuNi05Ny4zLDQzLjdjLTIzLjMsMjYuMy0zNSw1NS40LTM1LDg3LjV2MjI1LjljNDAuMSwyNC40LDg0LjIsMzYuNiwxMzIuMywzNi42YzM1LDAsNjguNy02LjcsMTAxLjItMjBjMzIuNC0xMy4zLDYwLjktMzIuMiw4NS4zLTU2LjZjMjQuNC0yNC40LDQzLjMtNTIuNyw1Ni42LTg0LjhjMTMuMy0zMi4xLDIwLTY1LjQsMjAtMTAwLjFjMC03Mi4yLTI1LjctMTM0LTc3LjEtMTg1LjRjLTUxLTUxLTExMi44LTc2LjYtMTg1LjQtNzYuNmMtNzIuOSwwLTEzNC45LDI1LjUtMTg1LjksNzYuNmMtMTkuMywxOS4zLTMzLjQsMzUuMi00Mi4xLDQ3LjZsLTEuMSwxLjFjLTIuOSw0LTUuMyw2LjgtNy4xLDguNWMtMS44LDEuNi01LjcsMy40LTExLjgsNS4ycy0xMywxLjMtMjEuMS0xLjZjLTcuNy0xLjgtMTQuMy00LjgtMjAtOWMtNS43LTQuMi04LjUtOS04LjUtMTQuNVYzMC44YzAtNS41LDEuOS0xMC4zLDUuNy0xNC41YzMuOC00LjIsOC44LTYuMywxNS02LjNoNDc5LjZjMTAuOSwwLDE2LjQsMTAsMTYuNCwzMC4xYzAsMjAuMS01LjUsMzAuMS0xNi40LDMwLjFIMzE0LjN2MjY0LjFoMC41YzE0LjYtMTUuMywzMy4yLTMwLjYsNTUuOC00NS45YzIyLjYtMTUuMyw0Mi4zLTI2LjQsNTkuMS0zMy40YzM5LjctMTYuOCw4MS44LTI1LjIsMTI2LjMtMjUuMmM0NC4xLDAsODUuNyw4LjQsMTI0LjcsMjUuMmMzOSwxNi44LDczLjEsMzkuNywxMDIuMyw2OC45YzI5LjUsMjkuNSw1Mi41LDYzLjQsNjguOSwxMDEuN0M4NjguNiw0NjYuNSw4NzcsNTA4LjIsODc3LDU1MC45TDg3Nyw1NTAuOXogTTg2MCwyMzMuMWMzLjMsMi45LDQuOSw2LjIsNC45LDkuOGMwLDMuNi0xLDYuOS0zLDkuOHMtNSw2LjctOSwxMS41Yy05LjUsOS41LTE2LjYsMTQuMi0yMS4zLDE0LjJjLTMuMywwLTYuMi0xLjMtOC44LTMuOGMtMzguNi0zMy4yLTc2LjQtNTcuNC0xMTMuMi03Mi43Yy00Ni43LTIwLjQtOTctMzAuNi0xNTAuOS0zMC42Yy00OC41LDAtOTYuMiw4LjktMTQzLjMsMjYuOGMtOS44LDMuNi0xOC0zLjEtMjQuNi0yMC4yYy0zLjMtOS4xLTQuNy0xNi00LjQtMjAuOGMxLjEtNS44LDQtOS41LDguOC0xMC45YzQ3LjQtMjAuOCwxMDEuOS0zMS4yLDE2My41LTMxLjJjNTkuOCwwLDExNy40LDExLjcsMTcyLjgsMzVDNzgxLjUsMTcxLjEsODI0LjMsMTk4LjgsODYwLDIzMy4xeiIgc3R5bGU9ImZpbGw6I2E5YjdiNyI+PC9wYXRoPjwvZz48L2c+PC9zdmc+CiAg',
|
||||
//'data:image/svg+xml;base64,CjxzdmcgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTAwMCAxMDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPG1ldGFkYXRhPiBTdmcgVmVjdG9yIEljb25zIDogaHR0cDovL3d3dy5vbmxpbmV3ZWJmb250cy5jb20vaWNvbiA8L21ldGFkYXRhPgogIDxnPjxnPjxnPjxwYXRoIGQ9Ik03MzUuMiw0OTAuMWMtMTUuOSwyLjEtMjksMTAtNDEuNCwxOS41Yy0xMy44LDEwLjYtMjUuNCwyMy41LTM3LjMsMzZjLTEuNiwxLjctMC45LDIuNiwwLjMsMy45YzguNCw5LjQsMTcsMTguNSwyNi44LDI2LjRjMTYuMywxMy4xLDMzLjksMjMuMiw1NS40LDI1LjJjMjQuMiwyLjMsNDMuOC05LjEsNTIuNC0zMWMzLTcuNiw0LjMtMTUuNSw0LjMtMjQuOGMwLjEtMi4zLTAuMy01LjctMC43LTkuMUM3OTEuMiw1MDUuOCw3NjUuNiw0ODYuMSw3MzUuMiw0OTAuMXoiIHN0eWxlPSJmaWxsOiNhOWI3YjciPjwvcGF0aD48cGF0aCBkPSJNNTMzLjQsNTA4LjhjLTEwLjMtNy40LTIxLjItMTQtMzMuNi0xNy4yYy0xOS00LjctMzYuMy0yLTQ5LjgsMTMuNWMtMTAuNSwxMi0xNS41LDI2LjItMTUuNSw0My4xYzAuMSwxLjUsMC4zLDQsMC41LDYuNWMyLjEsMjMuNiwxNy44LDQxLjIsNDAuNiw0NS40YzEyLjUsMi4zLDI0LjcsMC42LDM2LjUtNGMyNS4yLTkuOCw0NC40LTI3LjUsNjItNDcuNGMxLjMtMS41LDAuNi0yLjItMC40LTMuMkM1NjEuMSw1MzIuNSw1NDguMyw1MTkuNSw1MzMuNCw1MDguOHoiIHN0eWxlPSJmaWxsOiNhOWI3YjciPjwvcGF0aD48cGF0aCBkPSJNNTAwLDEwQzIyOS40LDEwLDEwLDIyOS40LDEwLDUwMHMyMTkuNCw0OTAsNDkwLDQ5MHM0OTAtMjE5LjQsNDkwLTQ5MFM3NzAuNiwxMCw1MDAsMTB6IE03NDEuOCw2NjguMmMtMzEtMC40LTU3LjQtMTIuNC04MS42LTMwLjdjLTE1LjgtMTItMjkuMy0yNi4zLTQyLjMtNDEuMWMtMi4yLTIuNS0zLjItMy01LjgtMC4zYy0xMy4zLDEzLjgtMjUuOSwyOC4zLTQwLjgsNDAuNGMtMTguOSwxNS4zLTM5LjcsMjYuOS02NC4xLDMwLjJjLTQzLjEsNS45LTgwLjMtNS41LTEwOS4zLTM5LjNjLTYuNi03LjctMTEuNS0xNi40LTE1LjYtMjUuN2MtMC41LTEuMi0wLjctMi42LTItMy41Yy01LjcsMTIuMy0xMi43LDIzLjUtMjEuOSwzMy4zYy0yMy4yLDI0LjctNTEuOSwzNy42LTg1LjcsMzguOGMtMjQuNCwwLjktNDguNC0yLjMtNzAuNy0xMi44Yy0zNy4zLTE3LjctNTcuOS00Ny4yLTYwLjQtODguOGMtMC4yLTMuMiwwLjctNCwzLjgtNGMyMC4xLDAuMSw0MC4yLDAuMSw2MC4zLDBjMywwLDMuOSwwLjksNC40LDMuOGMzLjksMjIuOSwxNi4yLDM4LjksMzkuMyw0NC42YzMyLjIsOCw2MS44LTEwLjMsNzAuMy00My41YzUuNy0yMi4zLDMuMi00My43LTExLjYtNjIuM2MtOS44LTEyLjMtMjMuMi0xOC40LTM4LjgtMTkuNWMtMjIuNS0xLjYtNDEsNS44LTU0LjMsMjQuNmMtMS4yLDEuOC0yLjcsMi4yLTQuNywyLjJjLTE4LjEtMC4xLTM2LjItMC4xLTU0LjMsMGMtMy4xLDAtMy44LTAuOS0zLjItMy45YzkuNC01Mi4yLDE4LjctMTA0LjUsMjgtMTU2LjdjMS4zLTcuMSwyLjYtMTQuMywzLjctMjEuNWMwLjQtMi4zLDEuMy0zLjIsMy44LTMuMmM2MC4xLDAuMSwxMjAuMiwwLjEsMTgwLjQsMGMyLjksMCwzLjUsMC45LDMuNSwzLjZjLTAuMSwxNi4xLTAuMiwzMi4yLDAsNDguNGMwLDMuMy0wLjgsNC4yLTQuMiw0LjJjLTQzLjEtMC4xLTg2LjEsMC0xMjkuMi0wLjJjLTMuNiwwLTUuMiwwLjYtNS44LDQuNmMtMy44LDIyLjktOCw0NS44LTEyLDY4LjdjLTAuMiwxLTAuOSwyLjMsMC4yLDIuOWMxLjIsMC43LDEuOC0wLjcsMi41LTEuNGMxOS43LTE5LDQzLjgtMjQuOCw3MC40LTIzLjRjMjUuNSwxLjQsNDcuNCwxMC45LDY1LjMsMjkuMWM3LjUsNy42LDEzLjMsMTYuMywxOC4xLDI1LjljMC41LDEsMSwyLjEsMS45LDMuOWM1LjEtMTMuNCwxMS40LTI1LjEsMjAuMy0zNS4yYzE5LjUtMjIuMiw0NC4yLTM0LjIsNzMuNS0zNi45YzQxLjMtMy44LDc1LjMsMTIuMSwxMDUsMzkuM2MxMi4zLDExLjIsMjMuMiwyMy44LDMzLjksMzYuNmMyLjMsMi43LDMuMywzLDUuNywwLjFjMTMuOC0xNi40LDI3LjUtMzIuOCw0NC41LTQ2LjFjMTkuNi0xNS4zLDQxLjEtMjYuNCw2Ni4xLTI5LjNjNjEuOC03LjIsMTEzLjUsMjYuNCwxMjYuNiw5MC4yYzUuNSwyNi44LDMuOCw1My40LTUuNSw3OS4yQzgzMi41LDY0MS41LDc5Mi43LDY2OC44LDc0MS44LDY2OC4yeiIgc3R5bGU9ImZpbGw6I2E5YjdiNyI+PC9wYXRoPjwvZz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PC9nPjwvc3ZnPgogIA==',
|
||||
|
||||
BIN
images/icons.png
Executable file
|
After Width: | Height: | Size: 729 B |
BIN
images/loader.gif
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
images/loading.gif
Executable file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
images/logo.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
images/monde.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/wikipedia.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
13
infos.txt
@@ -58,4 +58,17 @@ add_shortcode( 'zenphoto', 'zenphoto_handler' );
|
||||
|
||||
Media WP -> add_class_lightbox($content) -> img wordpress avec class="selector"
|
||||
|
||||
---------
|
||||
$coord()
|
||||
|
||||
array (size=9)
|
||||
0 => string '45.584731' (length=9)
|
||||
1 => string '7.318439' (length=8)
|
||||
2 => string '2016-01-07_Renard_2905' (length=22)
|
||||
3 => string '27868468454' (length=11)
|
||||
4 => string 'Etonnante rencontre dans le parc du Grand Paradis (Italie) Alors que l'on redescendait du refuge après une belle rando, j'aperçoit goupil qui monte par le même chemin. On stoppe. Il s'arrête à notre hauteur avant de reprendre sa route tranquillement. Puis il s'arrête de nouveau pour prendre la pose un peu plus haut.' (length=335)
|
||||
5 => string '<img id="lettrineImage" src="https://farm9.staticflickr.com/8176/27868468454_8f9afb79c4_m.jpg" alt=" " height="160" width="240" />' (length=130)
|
||||
6 => null
|
||||
7 => null
|
||||
8 => null
|
||||
|
||||
|
||||
BIN
js/flickr.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
js/recentpostsbutton.png
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
49
js/short-flickr.js
Normal file
@@ -0,0 +1,49 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.flickr', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('flickr', {
|
||||
title : 'Add Flickr Shortcode',
|
||||
image : url+'/flickr.png',
|
||||
onclick : function() {
|
||||
/*
|
||||
[flickr url="https://www.flickr.com/photos/funnymac/27868468454/"]
|
||||
|
||||
[flickr pid="27868468454" caption="Volpe di Paradisio"]
|
||||
|
||||
[flickr pid="27868468454" version="Small"]
|
||||
*/
|
||||
var pid = prompt("Image Id", "");
|
||||
if (pid == null || pid == ''){
|
||||
var url = prompt("URL image", "");
|
||||
}
|
||||
var version = prompt("Taille", "");
|
||||
var caption = prompt("Titre", "");
|
||||
|
||||
/**/
|
||||
if (pid != null && pid != ''){
|
||||
//if (album != null && album != '')
|
||||
ed.execCommand('mceInsertContent', false, '[flickr pid="'+pid+'" version="'+version+'" caption="'+caption+'"]');
|
||||
}
|
||||
else if (url != null && url != ''){
|
||||
//if (album != null && album != '')
|
||||
ed.execCommand('mceInsertContent', false, '[flickr url="'+url+'" version="'+version+'" caption="'+caption+'"]');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
},
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : "Flickr Shortcode",
|
||||
author : 'Bruno',
|
||||
authorurl : 'https://clicclac.info',
|
||||
infourl : 'https://clicclac.info/wordpress/',
|
||||
version : "1.0"
|
||||
};
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('flickr', tinymce.plugins.flickr);
|
||||
})();
|
||||
@@ -3,7 +3,7 @@
|
||||
init : function(ed, url) {
|
||||
ed.addButton('zenphoto', {
|
||||
title : 'Add Zenphoto Shortcode',
|
||||
image : url+'/recentpostsbutton.png',
|
||||
image : url+'/zenphoto.png',
|
||||
onclick : function() {
|
||||
var album = prompt("Album", "");
|
||||
var image = prompt("Image", "");
|
||||
|
||||
BIN
js/zenphoto.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
@@ -1,8 +1,8 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Creator Responsive WordPress Theme Child\n"
|
||||
"POT-Creation-Date: 2017-01-31 06:26+0100\n"
|
||||
"PO-Revision-Date: 2017-01-31 06:27+0100\n"
|
||||
"POT-Creation-Date: 2017-02-14 06:43+0100\n"
|
||||
"PO-Revision-Date: 2017-02-14 06:43+0100\n"
|
||||
"Last-Translator: Bruno <bruno@clicclac.info>\n"
|
||||
"Language-Team: Bruno <bruno@clicclac.info>\n"
|
||||
"Language: fr_FR\n"
|
||||
@@ -21,40 +21,6 @@ msgstr ""
|
||||
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
||||
"X-Poedit-SearchPathExcluded-1: -child\n"
|
||||
|
||||
#: Pagination/ce-mois.php:138 ce-mois-ci.php:145 ce-mois.php:138
|
||||
msgid "The"
|
||||
msgstr "Le"
|
||||
|
||||
#: Pagination/ce-mois.php:138 ce-mois-ci.php:145 ce-mois.php:138
|
||||
#: functions.php:1037
|
||||
msgid "F j, Y, g:i a"
|
||||
msgstr "d.m.Y à H:i"
|
||||
|
||||
#: Pagination/ce-mois.php:139 ce-mois-ci.php:146 ce-mois.php:139
|
||||
msgid " at "
|
||||
msgstr " à "
|
||||
|
||||
#: Pagination/ce-mois.php:139 ce-mois-ci.php:146 ce-mois.php:139
|
||||
msgid "Focal"
|
||||
msgstr "Focale "
|
||||
|
||||
#: Pagination/ce-mois.php:211 Pagination/ce-mois.php:212 ce-mois-ci.php:289
|
||||
#: ce-mois-ci.php:290 ce-mois.php:211 ce-mois.php:212
|
||||
msgid "Archives"
|
||||
msgstr "Archives"
|
||||
|
||||
#: Pagination/ce-mois.php:212 ce-mois-ci.php:290 ce-mois.php:212
|
||||
msgid "Help"
|
||||
msgstr "Aide"
|
||||
|
||||
#: Pagination/header.php:63 header-page.php:151
|
||||
msgid "Tel: "
|
||||
msgstr "Tél. :"
|
||||
|
||||
#: Pagination/header.php:64 header-page.php:152
|
||||
msgid "Email: "
|
||||
msgstr "Email :"
|
||||
|
||||
#: accueil.php:42
|
||||
msgid "Previous"
|
||||
msgstr "Précédent"
|
||||
@@ -79,6 +45,30 @@ msgstr "Lire plus d'entrées de blog..."
|
||||
msgid "Sorry, no posts found."
|
||||
msgstr "Désolé, aucun post trouvé."
|
||||
|
||||
#: ce-mois-ci.php:145
|
||||
msgid "The"
|
||||
msgstr "Le"
|
||||
|
||||
#: ce-mois-ci.php:145 functions.php:1082
|
||||
msgid "F j, Y, g:i a"
|
||||
msgstr "d.m.Y à H:i"
|
||||
|
||||
#: ce-mois-ci.php:146
|
||||
msgid " at "
|
||||
msgstr " à "
|
||||
|
||||
#: ce-mois-ci.php:146
|
||||
msgid "Focal"
|
||||
msgstr "Focale "
|
||||
|
||||
#: ce-mois-ci.php:289 ce-mois-ci.php:290
|
||||
msgid "Archives"
|
||||
msgstr "Archives"
|
||||
|
||||
#: ce-mois-ci.php:290
|
||||
msgid "Help"
|
||||
msgstr "Aide"
|
||||
|
||||
#: ce-mois-ci.php:318
|
||||
msgid "Previous Page"
|
||||
msgstr "Page précédente"
|
||||
@@ -91,54 +81,6 @@ msgstr "Page"
|
||||
msgid "Next Page"
|
||||
msgstr "Page suivante"
|
||||
|
||||
#: fetch_pages.php:105 fonctions.php:116 functions.php:225
|
||||
msgid "January"
|
||||
msgstr "Janvier"
|
||||
|
||||
#: fetch_pages.php:108 fonctions.php:119 functions.php:228
|
||||
msgid "February"
|
||||
msgstr "Février"
|
||||
|
||||
#: fetch_pages.php:111 fonctions.php:122 functions.php:231
|
||||
msgid "March"
|
||||
msgstr "Mars"
|
||||
|
||||
#: fetch_pages.php:114 fonctions.php:125 functions.php:234
|
||||
msgid "April"
|
||||
msgstr "Avril"
|
||||
|
||||
#: fetch_pages.php:117 fonctions.php:128 functions.php:237
|
||||
msgid "May"
|
||||
msgstr "Mai"
|
||||
|
||||
#: fetch_pages.php:120 fonctions.php:131 functions.php:240
|
||||
msgid "June"
|
||||
msgstr "Juin"
|
||||
|
||||
#: fetch_pages.php:123 fonctions.php:134 functions.php:243
|
||||
msgid "July"
|
||||
msgstr "Juillet"
|
||||
|
||||
#: fetch_pages.php:126 fonctions.php:137 functions.php:246
|
||||
msgid "August"
|
||||
msgstr "Aout"
|
||||
|
||||
#: fetch_pages.php:129 fonctions.php:140 functions.php:249
|
||||
msgid "September"
|
||||
msgstr "Septembre"
|
||||
|
||||
#: fetch_pages.php:132 fonctions.php:143 functions.php:252
|
||||
msgid "October"
|
||||
msgstr "Octobre"
|
||||
|
||||
#: fetch_pages.php:135 fonctions.php:146 functions.php:255
|
||||
msgid "November"
|
||||
msgstr "Novembre"
|
||||
|
||||
#: fetch_pages.php:138 fonctions.php:149 functions.php:258
|
||||
msgid "December"
|
||||
msgstr "Décembre"
|
||||
|
||||
#: footer.php:24
|
||||
msgid "2016 Copyright. Powered by WordPress"
|
||||
msgstr "2016 Copyright. Propulsé par WordPress"
|
||||
@@ -147,116 +89,169 @@ msgstr "2016 Copyright. Propulsé par WordPress"
|
||||
msgid "Your subscription is manually enabled."
|
||||
msgstr "Votre abonnement est activée manuellement."
|
||||
|
||||
#: functions.php:141
|
||||
#: functions.php:144
|
||||
msgid "yesterday"
|
||||
msgstr "hier"
|
||||
|
||||
#: functions.php:142
|
||||
#: functions.php:145
|
||||
msgid "the day before yesterday"
|
||||
msgstr "avant-hier"
|
||||
|
||||
#: functions.php:143
|
||||
#: functions.php:146
|
||||
msgid "two days ago"
|
||||
msgstr "avant-avant-hier"
|
||||
|
||||
#: functions.php:144
|
||||
#: functions.php:147
|
||||
#, php-format
|
||||
msgid "%1$s days ago"
|
||||
msgstr "il y a %1$s jours"
|
||||
|
||||
#: functions.php:147
|
||||
#: functions.php:150
|
||||
#, php-format
|
||||
msgid "%1$s week ago"
|
||||
msgstr "il y a %1$s semaine"
|
||||
|
||||
#: functions.php:148
|
||||
#: functions.php:151
|
||||
#, php-format
|
||||
msgid "%1$s weeks ago"
|
||||
msgstr "il y a %1$s semaines"
|
||||
|
||||
#: functions.php:491
|
||||
#: functions.php:228
|
||||
msgid "January"
|
||||
msgstr "Janvier"
|
||||
|
||||
#: functions.php:231
|
||||
msgid "February"
|
||||
msgstr "Février"
|
||||
|
||||
#: functions.php:234
|
||||
msgid "March"
|
||||
msgstr "Mars"
|
||||
|
||||
#: functions.php:237
|
||||
msgid "April"
|
||||
msgstr "Avril"
|
||||
|
||||
#: functions.php:240
|
||||
msgid "May"
|
||||
msgstr "Mai"
|
||||
|
||||
#: functions.php:243
|
||||
msgid "June"
|
||||
msgstr "Juin"
|
||||
|
||||
#: functions.php:246
|
||||
msgid "July"
|
||||
msgstr "Juillet"
|
||||
|
||||
#: functions.php:249
|
||||
msgid "August"
|
||||
msgstr "Aout"
|
||||
|
||||
#: functions.php:252
|
||||
msgid "September"
|
||||
msgstr "Septembre"
|
||||
|
||||
#: functions.php:255
|
||||
msgid "October"
|
||||
msgstr "Octobre"
|
||||
|
||||
#: functions.php:258
|
||||
msgid "November"
|
||||
msgstr "Novembre"
|
||||
|
||||
#: functions.php:261
|
||||
msgid "December"
|
||||
msgstr "Décembre"
|
||||
|
||||
#: functions.php:497
|
||||
msgid "Unknow album."
|
||||
msgstr "Album inconnu."
|
||||
|
||||
#: functions.php:504
|
||||
#: functions.php:509 functions.php:524
|
||||
msgid "Unknow image."
|
||||
msgstr "Image inconnu."
|
||||
|
||||
#: functions.php:756
|
||||
#: functions.php:767
|
||||
msgid "Post navigation"
|
||||
msgstr "Navigation"
|
||||
|
||||
#: functions.php:759
|
||||
#: functions.php:770
|
||||
msgctxt "Previous post link"
|
||||
msgid "<span class=\"meta-nav\">←</span> %title"
|
||||
msgstr "<span class=\"meta-nav\">←</span> %title"
|
||||
|
||||
#: functions.php:760
|
||||
#: functions.php:771
|
||||
msgctxt "Next post link"
|
||||
msgid "%title <span class=\"meta-nav\">→</span>"
|
||||
msgstr "%title <span class=\"meta-nav\">→</span>"
|
||||
|
||||
#: functions.php:779
|
||||
#: functions.php:790
|
||||
msgid "Sticky"
|
||||
msgstr "Épingle"
|
||||
|
||||
#: functions.php:785 functions.php:791
|
||||
#: functions.php:796 functions.php:802
|
||||
msgid ", "
|
||||
msgstr ", "
|
||||
|
||||
#: functions.php:800
|
||||
#: functions.php:811
|
||||
#, php-format
|
||||
msgid "View all posts by %s"
|
||||
msgstr "Voir tous les articles de %s"
|
||||
|
||||
#: functions.php:821
|
||||
#: functions.php:832
|
||||
#, php-format
|
||||
msgctxt "1: post format name. 2: date"
|
||||
msgid "%1$s on %2$s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:827
|
||||
#: functions.php:838
|
||||
#, php-format
|
||||
msgid "Permalink to %s"
|
||||
msgstr "Permalien vers %s"
|
||||
|
||||
#: functions.php:1585
|
||||
#: functions.php:1633
|
||||
msgid "Settings"
|
||||
msgstr "Paramètres"
|
||||
|
||||
#: functions.php:1587
|
||||
#: functions.php:1635
|
||||
msgid "Theme settings"
|
||||
msgstr "Paramètres du thème"
|
||||
|
||||
#: functions.php:1598
|
||||
#: functions.php:1646
|
||||
msgid "Zenphoto path"
|
||||
msgstr "Chemin de Zenphoto"
|
||||
|
||||
#: functions.php:1609
|
||||
#: functions.php:1657
|
||||
msgid "Zenphoto image size (px)"
|
||||
msgstr "Taille images Zenphoto (px)"
|
||||
|
||||
#: functions.php:1668
|
||||
msgid "Socials icons size (16 or 32px)"
|
||||
msgstr "Taille icônes sociaux (16 ou 32px)"
|
||||
|
||||
#: functions.php:1620
|
||||
#: functions.php:1679
|
||||
msgid "Lightbox selector (class=\"xxx\")"
|
||||
msgstr "Sélecteur pour Lightbox (class = \"xxx\")"
|
||||
|
||||
#: functions.php:1628
|
||||
#: functions.php:1687
|
||||
msgid "Choice of lightbox"
|
||||
msgstr "Choix de la lightbox"
|
||||
|
||||
#: functions.php:1645
|
||||
#: functions.php:1704
|
||||
msgid "Display EXIFs"
|
||||
msgstr "Afficher les EXIFs"
|
||||
|
||||
#: functions.php:1656
|
||||
#: functions.php:1715
|
||||
msgid "Display Geo datas"
|
||||
msgstr "Afficher données GPS"
|
||||
|
||||
#: functions.php:1667
|
||||
#: functions.php:1726
|
||||
msgid "Display meta (single)"
|
||||
msgstr "Afficher les metas (single)"
|
||||
|
||||
#: header.php:17 header.php:19 header.php:24 single.php:61
|
||||
#: header.php:17 header.php:19 header.php:24 single.php:233
|
||||
#: single.php.bak.php:159
|
||||
msgid "Display"
|
||||
msgstr "Afficher"
|
||||
|
||||
@@ -272,7 +267,7 @@ msgstr "Afficher les commentaires"
|
||||
msgid "Hide comments"
|
||||
msgstr "Masquer les commentaires"
|
||||
|
||||
#: livre-d-or.php:30 single.php:30
|
||||
#: livre-d-or.php:30 single.php:202 single.php.bak.php:128
|
||||
msgid "Pages"
|
||||
msgstr "Pages"
|
||||
|
||||
@@ -296,25 +291,33 @@ msgstr "Rechercher:"
|
||||
msgid "Search"
|
||||
msgstr "Rechercher"
|
||||
|
||||
#: single.php:36
|
||||
#: single.php:194
|
||||
msgid "Show map"
|
||||
msgstr "Afficher la carte"
|
||||
|
||||
#: single.php:195
|
||||
msgid "Hide map"
|
||||
msgstr "Masquer la carte"
|
||||
|
||||
#: single.php:208 single.php.bak.php:134
|
||||
msgid "Tags: "
|
||||
msgstr "Mots-clés: "
|
||||
|
||||
#. translators: %s: Name of current post
|
||||
#: single.php:44
|
||||
#: single.php:216 single.php.bak.php:142
|
||||
#, php-format
|
||||
msgid "Edit post<span class=\"screen-reader-text\"> \"%s\"</span>"
|
||||
msgstr "Editer l'article<span class=\"screen-reader-text\"> \"%s\"</span>"
|
||||
|
||||
#: single.php:62
|
||||
#: single.php:234 single.php.bak.php:160
|
||||
msgid " 0 Comment"
|
||||
msgstr " 0 commentaire"
|
||||
|
||||
#: single.php:62
|
||||
#: single.php:234 single.php.bak.php:160
|
||||
msgid " 1 Comment"
|
||||
msgstr " 1 commentaire"
|
||||
|
||||
#: single.php:62
|
||||
#: single.php:234 single.php.bak.php:160
|
||||
msgid " Comments"
|
||||
msgstr " Commentaires"
|
||||
|
||||
@@ -348,6 +351,12 @@ msgstr ""
|
||||
msgid "http://dessign.net"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "Tel: "
|
||||
#~ msgstr "Tél. :"
|
||||
|
||||
#~ msgid "Email: "
|
||||
#~ msgstr "Email :"
|
||||
|
||||
#~ msgid "0 Comment"
|
||||
#~ msgstr "0 commentaire"
|
||||
|
||||
|
||||
BIN
screenshot.jpg
Normal file
|
After Width: | Height: | Size: 67 KiB |
306
single.php
@@ -1,6 +1,36 @@
|
||||
<?php
|
||||
//tideways_enable(TIDEWAYS_FLAGS_NO_SPANS);
|
||||
|
||||
get_header();
|
||||
//include('exifer/exif.php');
|
||||
|
||||
/**/
|
||||
//$xhprof_data = tideways_disable();
|
||||
|
||||
//var_dump($xhprof_data);
|
||||
/*
|
||||
//$tmpfile = sys_get_temp_dir() . uniqid() . ".myapp.xhprof";
|
||||
$tmpfile = "/tmp/" . uniqid() . ".myapp.xhprof";
|
||||
echo $tmpfile;
|
||||
file_put_contents( $tmpfile, serialize($xhprof_data) );
|
||||
*/
|
||||
|
||||
/*
|
||||
$XHPROF_ROOT = "/Users/bruno/Sites/xhprof";
|
||||
define('XHPROF_LIB_ROOT', $XHPROF_ROOT . '/xhprof_lib');
|
||||
|
||||
include_once $XHPROF_ROOT . "/xhprof_lib/config.php";
|
||||
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
|
||||
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";
|
||||
|
||||
$xhprof_runs = new XHProfRuns_Default();
|
||||
$run_id = $xhprof_runs->save_run($xhprof_data, "myapp");
|
||||
echo "---------------\n".
|
||||
"Assuming you have set up the http based UI for \n".
|
||||
"XHProf at some address, you can view run at \n".
|
||||
"http://dev.macbook-pro.local/index.php?run=$run_id&source=myapp\n".
|
||||
"---------------\n";
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="content">
|
||||
<div class="container">
|
||||
@@ -9,10 +39,6 @@ get_header();
|
||||
<article class="post_box" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1><?php the_title(); ?></h1>
|
||||
|
||||
<?php //echo get_stylesheet_directory_uri();
|
||||
//$a = include(get_stylesheet_directory_uri() . '/exifer/exif.php');
|
||||
//echo "a: " . $a;
|
||||
?>
|
||||
<div class="entry-meta">
|
||||
<?php if (dess_setting('dess_display_meta') == true) creator_entry_meta(); ?>
|
||||
<?php //edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
@@ -20,32 +46,142 @@ get_header();
|
||||
|
||||
<?php
|
||||
$coord = array();
|
||||
$compt_marker = 0;
|
||||
|
||||
|
||||
the_content();
|
||||
|
||||
?>
|
||||
|
||||
<?php //$content = apply_filters('the_content', get_the_content());
|
||||
//echo $content;
|
||||
<?php //echo '<div id="map" style="display: ' . ((count($coord) > 0) ? "block" : "none") . ';"></div>';
|
||||
|
||||
//preprint ($coord);
|
||||
//var_dump($coord);
|
||||
|
||||
echo '<div id="map" style="display: ' . ((count($coord) > 0) ? "block" : "none") . ';"></div>';
|
||||
if (count($coord) > 0) {
|
||||
|
||||
$b = array();
|
||||
|
||||
// Avec tous les titres, on crée la requete pour Wikipédia
|
||||
|
||||
for ($a = 0; $a < count($coord); $a++){
|
||||
$short = $coord[$a][6]; // Titre
|
||||
/*
|
||||
Flickr: 2016-01-07_Renard_2905
|
||||
WP:
|
||||
ZP:
|
||||
*/
|
||||
$b[] = $short;
|
||||
}
|
||||
|
||||
//var_dump($b);
|
||||
|
||||
//echo "coord avant requete Wikipedia";
|
||||
//var_dump($coord);
|
||||
|
||||
$wiki = fmulticurl($b);
|
||||
|
||||
//On rajoute à $coord les données récupérées sur Wikipédia
|
||||
|
||||
if (count($coord) == count($wiki)) {
|
||||
for ($c = 0; $c < count($wiki); $c++){
|
||||
// [0] 1ere réponse, la plus pertinante
|
||||
//array_push($coord[$c], $lettrine, $wiki[$c][1][0], $wiki[$c][2][0], $wiki[$c][3][0]);
|
||||
// Requete - Texte Wikipedia - Url Wikipedia
|
||||
array_push($coord[$c], $wiki[$c][1][0], $wiki[$c][2][0], $wiki[$c][3][0]);
|
||||
//array_push($coord[$c], $wiki[$c][2][0], $wiki[$c][3][0]);
|
||||
}
|
||||
}
|
||||
|
||||
//echo "coord après requete Wikipedia";
|
||||
var_dump($coord);
|
||||
?>
|
||||
|
||||
<script>
|
||||
function initMap() {
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery(document).ready(function ($) { // wait until the document is ready
|
||||
data = false;
|
||||
|
||||
$('button#showmap').click(function(){
|
||||
if (data == false) {
|
||||
$.ajax({
|
||||
url: "http://maps.googleapis.com/maps/api/js?key=AIzaSyB7cAx3NSH4dPM3Sx2oQeud7Zr-KaGXmLk&sensor=false&callback=MapApiLoaded",
|
||||
dataType: "script",
|
||||
timeout:8000,
|
||||
success: function(data) {
|
||||
// Run the code here that needs
|
||||
// to access the data returned
|
||||
data = true;
|
||||
return data;
|
||||
},
|
||||
error: function() {
|
||||
alert('Error occured');
|
||||
}
|
||||
});
|
||||
}
|
||||
$( "#locations" ).toggle( "fast");
|
||||
|
||||
$( "button#hidemap" ).show();
|
||||
$( "button#showmap" ).hide();
|
||||
$( "i.ion-ios-location" ).show();
|
||||
|
||||
}); // button#showmap
|
||||
|
||||
$('button#hidemap').click(function(){
|
||||
$( "#locations" ).toggle( "fast");
|
||||
$( "button#hidemap" ).hide();
|
||||
$( "button#showmap" ).show();
|
||||
$( "i.ion-ios-location" ).hide();
|
||||
data = true;
|
||||
});
|
||||
|
||||
}); // jQuery
|
||||
|
||||
var map;
|
||||
var markers = [];
|
||||
var cnt;
|
||||
|
||||
var locations = [
|
||||
<?php
|
||||
$j = (count($coord) - 1);
|
||||
for ($i = 0; $i <= $j; $i++) {
|
||||
//echo "['<h4>" . $coord[$i][2] . "</h4>', " . $coord[$i][0] . ", " . $coord[$i][1] . "]" . (($i<$j) ? "," : "")."\r\n";
|
||||
echo "['<span class\"infowindow\">" . $coord[$i][2] . "</span>', " . $coord[$i][0] . ", " . $coord[$i][1] . "]" . (($i<$j) ? "," : "")."\r\n";
|
||||
echo "['<h1>" . addslashes($coord[$i][2]) . "</h1>','<p>" . addslashes($coord[$i][4]) . "</p>', " . $coord[$i][0] . ", " . $coord[$i][1] . ",'" . addslashes($coord[$i][5]) . "','" . addslashes($coord[$i][8]) . "','" . $coord[$i][9] . "']" . (($i<$j) ? "," : "")."\r\n";
|
||||
//echo "['<h1>" . addslashes($coord[$i][2]) . "</h1>','<p>" . addslashes($coord[$i][4]) . "</p>', " . $coord[$i][0] . ", " . $coord[$i][1] . ",'" . addslashes($coord[$i][5]) . "','" . (($coord[$i][8] != "") ? addslashes($coord[$i][8]) : addslashes($coord[$i][4])) . "','" . $coord[$i][9] . "']" . (($i<$j) ? "," : "")."\r\n";
|
||||
}
|
||||
|
||||
(($coord[$i][8] != "") ? addslashes($coord[$i][8]) : addslashes($coord[$i][4]))
|
||||
//array_push($coord, array($meta['latitude'], $meta['longitude'], $caption, $pid, $description, $img_thumb_ZP_wiki, $requete_wiki));
|
||||
|
||||
/*
|
||||
locations[0] => $coord[2] => Titre (court)
|
||||
locations[1] => $coord[4] => Description (long)
|
||||
locations[2] => $coord[0] => Latitude
|
||||
locations[3] => $coord[1] => Longitude
|
||||
locations[4] => $coord[5] => <img "letrine">
|
||||
locations[5] => $coord[8] => Texte Wikipedia
|
||||
locations[6] => $coord[9] => Liens vers Wikipedia
|
||||
$coord[3] => attachment
|
||||
$coord[6] => requete wiki ->
|
||||
$coord[7] => <- requete wiki
|
||||
*/
|
||||
|
||||
?>
|
||||
];
|
||||
|
||||
var wikiLink = '';
|
||||
var contenuInfoBulle = [];
|
||||
|
||||
|
||||
function MapApiLoaded() {
|
||||
|
||||
// Setup the different icons and shadows
|
||||
var iconURLPrefix = 'https://maps.google.com/mapfiles/ms/icons/';
|
||||
|
||||
var root = location.protocol + '//' + location.host;
|
||||
var wikiImg = root + '/wordpress/wp-content/themes/CreatorThemeRes-child/images/wikipedia.png';
|
||||
var wikiUrl = '<img src=\"' + wikiImg + '\" width=\"32\" height=\"32\" class=\"wiki\" />';
|
||||
|
||||
var icons = [
|
||||
iconURLPrefix + 'red-dot.png',
|
||||
iconURLPrefix + 'green-dot.png',
|
||||
@@ -57,56 +193,146 @@ get_header();
|
||||
]
|
||||
var iconsLength = icons.length;
|
||||
|
||||
window.map = new google.maps.Map(document.getElementById('map'), {
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
// Create google map
|
||||
map = new google.maps.Map($('#gmap')[0], {
|
||||
zoom:8,
|
||||
mapTypeId:google.maps.MapTypeId.ROADMAP,
|
||||
panControl:false,
|
||||
streetViewControl:false,
|
||||
mapTypeControl:true
|
||||
});
|
||||
|
||||
var infowindow = new google.maps.InfoWindow();
|
||||
infowindow = new google.maps.InfoWindow();
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
var iconCounter = 0;
|
||||
for (i = 0; i < locations.length; i++) {
|
||||
marker = new google.maps.Marker({
|
||||
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
|
||||
position: new google.maps.LatLng(locations[i][2], locations[i][3]),
|
||||
map: map,
|
||||
icon: icons[iconCounter]
|
||||
icon: icons[iconCounter],
|
||||
title: locations[i][0]
|
||||
});
|
||||
|
||||
markers.push(marker);
|
||||
|
||||
|
||||
if (locations[i][6] != '') {
|
||||
wikiLink = '<a href=\"' + locations[i][6] + '\" title=\"Plus sur Wikipedia...\">' + wikiUrl + '</a>';
|
||||
}
|
||||
contenuInfoBulle[i] = locations[i][0] + locations[i][4] + locations[i][1] + locations[i][5] + '<br />' + wikiLink;
|
||||
/*
|
||||
locations[0] => $coord[2] => Titre (court)
|
||||
locations[4] => $coord[5] => <img "letrine">
|
||||
locations[1] => $coord[4] => Description (long)
|
||||
locations[5] => $coord[8] => Texte Wikipedia
|
||||
locations[6] => $coord[9] => Liens vers Wikipedia
|
||||
*/
|
||||
|
||||
var zoom = 1;
|
||||
a = map.getZoom();
|
||||
bounds.extend(marker.position);
|
||||
|
||||
google.maps.event.addListener(marker, 'click', (function (marker, i) {
|
||||
return function () {
|
||||
// add the double-click event listener
|
||||
google.maps.event.addListener(marker, 'dblclick', function() {
|
||||
map.panTo(this.getPosition());
|
||||
//map.setZoom(9);
|
||||
if (zoom == 1) {
|
||||
if (map.getZoom() < (a + 6)) {
|
||||
map.setZoom(map.getZoom() + 2);
|
||||
}
|
||||
else zoom = 0;
|
||||
}
|
||||
else if (zoom == 0) {
|
||||
if (map.getZoom() >= a) {
|
||||
map.setZoom(map.getZoom() - 2);
|
||||
}
|
||||
else zoom = 1;
|
||||
}
|
||||
});
|
||||
|
||||
/*https://www.touraineverte.fr/google-maps-api-version-3/exemple-tutoriel-infobulles-infowindows/ajouter-infowindow-infobulle-marqueur-defaut-api-google-maps-version-3.html*/
|
||||
|
||||
/*
|
||||
var contentString = '<div id="content">'+
|
||||
'<div id="siteNotice">'+
|
||||
'</div>'+
|
||||
'<h1 id="firstHeading" class="firstHeading">' + locations[i][0] + '</h1>'+
|
||||
'<div id="bodyContent">'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
infowindow.setContent(contentString);
|
||||
var contenuInfoBulle = '<h1>Cité Royale de Loches</h1>' +
|
||||
'<h2>Royale et imprenable</h2>' +
|
||||
'<img id="lettrineImage" src="https://static.touraineverte.fr/googlemapsapiversion3/photo_monument-loches.jpg" title="La cité royale de Loches" />' +
|
||||
'<p>Remontez le temps pour découvrir l\'une des plus belles cités fortifiées de France.</p>' +
|
||||
'<p>Le <b>DONJON</b>, haut de 36 mètres, a été construit par un comte d\'Anjou, Foulques Nerra, au début du XIe siècle. S\'il figure parmi les plus imposants de son époque en Europe, il est aussi l\'un des mieux conservés. Modèle d\'architecture militaire, il est transformé en prison royale par Louis XI.</p>' +
|
||||
'<p>Le <b>LOGIS ROYAL</b> se trouve à proximité. Ce joyau de la Renaissance française, haut lieu de l\'Histoire de France, a été une résidence de prédilection de la dynastie des Valois. Sa façade ouverte en terrasse domine la ville et la vallée de l\'Indre. Le logis a accueilli notamment Jeanne d\'Arc, Agnès Sorel et Anne de Bretagne. Pour en savoir plus : <a href="http://www.cg37.fr/index.php?media=106" title="La cité royale de Loches" target="_parent">La cité royale de Loches</a></p>';
|
||||
*/
|
||||
infowindow.setContent(locations[i][0]);
|
||||
/*
|
||||
<h1>Titre</h1> =>
|
||||
<h2>Sous-titre</h2>
|
||||
Lettrine image
|
||||
<p>Description</p>
|
||||
*/
|
||||
|
||||
google.maps.event.addListener(marker, 'mousemove', (function (marker, i) {
|
||||
return function () {
|
||||
|
||||
/*
|
||||
var wikiLink = ''
|
||||
if (locations[i][6] != '') {
|
||||
wikiLink = '<a href=\"' + locations[i][6] + '\" title=\"Plus sur Wikipedia...\">' + wikiUrl + '</a>';
|
||||
}
|
||||
|
||||
var contenuInfoBulle = locations[i][0] + locations[i][4] + locations[i][1] + locations[i][5] + '<br />' + wikiLink;
|
||||
*/
|
||||
|
||||
infowindow.setContent(contenuInfoBulle[i]);
|
||||
infowindow.open(map, marker);
|
||||
}
|
||||
})(marker, i));
|
||||
|
||||
iconCounter++;
|
||||
if (iconCounter >= iconsLength) {
|
||||
iconCounter = 0;
|
||||
}
|
||||
|
||||
} // for
|
||||
|
||||
map.fitBounds(bounds);
|
||||
|
||||
var listener = google.maps.event.addListener(map, "idle", function () {
|
||||
map.setZoom(8);
|
||||
google.maps.event.removeListener(listener);
|
||||
});
|
||||
} //MapApiLoaded
|
||||
|
||||
function jumpToMarker(cnt){
|
||||
map.panTo(markers[cnt].getPosition());
|
||||
if (map.getZoom() < 15) {
|
||||
map.setZoom(a + 4);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
infowindow.setContent(contenuInfoBulle[cnt]);
|
||||
infowindow.open(map, markers[cnt]);
|
||||
}, 300);
|
||||
} //jumpToMarker
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div id="locations">
|
||||
<?php
|
||||
$j = (count($coord) - 1);
|
||||
echo "<div id='center_marker'><ul class='list_marker'>";
|
||||
for ($i = 0; $i <= $j; $i++) {
|
||||
//<a href="javascript:void(0);" onclick="jumpToMarker(4)" class="button3">PontDArc</a>
|
||||
echo "<li><i class='ion-ios-location'></i><a href='#gmap' onclick='jumpToMarker(" . $i . ")'>" . $coord[$i][2] . "</a></li>";
|
||||
}
|
||||
echo "</ul></div>";
|
||||
?>
|
||||
|
||||
<div id="gmap" style="width: 800px; height: 600px; border:1px solid #999;" class="aligncenter"></div>
|
||||
</div>
|
||||
|
||||
<button type="button" id="showmap"><?php _e('Show map','CreatorThemeRes-child'); ?></button>
|
||||
<button type="button" id="hidemap"><?php _e('Hide map','CreatorThemeRes-child'); ?></button>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
98
style.css
@@ -143,7 +143,6 @@ input.search-field {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
|
||||
#archive {
|
||||
margin: 0 0 80px;
|
||||
}
|
||||
@@ -154,6 +153,7 @@ input.search-field {
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
text-align: center;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.exif-data {
|
||||
@@ -161,21 +161,115 @@ input.search-field {
|
||||
margin-right: 16px;
|
||||
font-size: 10px;
|
||||
}
|
||||
.cible i.ion-ios-location {
|
||||
display: none;
|
||||
color: green;
|
||||
padding: 3px;
|
||||
}
|
||||
.cible i.ion-ios-location:hover {
|
||||
color: #00b701;
|
||||
}
|
||||
|
||||
div#locations {
|
||||
display: none;
|
||||
}
|
||||
button#hidemap {
|
||||
display: none;
|
||||
margin-bottom: 24px;
|
||||
margin-top: 32px;
|
||||
}
|
||||
button#showmap {
|
||||
margin-bottom: 24px;
|
||||
margin-top: 32px;
|
||||
}
|
||||
div#center_marker {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
ul.list_marker {
|
||||
padding-left: 0;
|
||||
margin: 2px auto;
|
||||
}
|
||||
/**/
|
||||
ul.list_marker a {
|
||||
text-decoration: none;
|
||||
color: green;
|
||||
}
|
||||
ul.list_marker a:hover {
|
||||
color: #00b701;
|
||||
}
|
||||
|
||||
ul.list_marker li {
|
||||
color: green !important;
|
||||
}
|
||||
ul.list_marker li:hover {
|
||||
color: #00b701 !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.list_marker li {
|
||||
display: inline;
|
||||
font-size: 10px;
|
||||
padding-right: 8px;
|
||||
padding-left: 8px;
|
||||
list-style-image: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
/* googlempa */
|
||||
|
||||
.infowindow, .gm-style-iw {
|
||||
color: #5f5f5f;
|
||||
font: normal normal 12px "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
.infowindow, .gm-style-iw a {
|
||||
color: black;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.infowindow, .gm-style-iw img {
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
#lettrineImage{
|
||||
float: left;
|
||||
width: 220px;
|
||||
height: 163px;
|
||||
margin: 0 1em 1em 0;
|
||||
}
|
||||
#map {
|
||||
width: 600px;
|
||||
height: 400px;
|
||||
display: none;
|
||||
margin: 5em auto;
|
||||
}
|
||||
|
||||
#gmap h1{
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 1.6em;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
color:#267AA8;
|
||||
text-align:center;
|
||||
}
|
||||
#gmap h2{
|
||||
margin-bottom:1em;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 1.3em;
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
color:#FF9900;
|
||||
text-align:center;
|
||||
}
|
||||
#gmap p{
|
||||
font: 1em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
|
||||
}
|
||||
/* Single */
|
||||
|
||||
.zenphoto {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.wp-caption {
|
||||
margin-top: 24px !important;
|
||||
margin-bottom: 8px !important;
|
||||
|
||||
450
tpl-carte.php
Executable file
@@ -0,0 +1,450 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: Carte
|
||||
*/
|
||||
|
||||
//http://www.wpbeginner.com/wp-themes/how-to-get-all-post-attachments-in-wordpress-except-for-featured-image/
|
||||
//http://wordpress.stackexchange.com/questions/61393/get-images-attached-to-post
|
||||
//http://wordpress.stackexchange.com/questions/11662/get-all-images-in-media-gallery
|
||||
|
||||
get_header();
|
||||
|
||||
$query_images_args = array(
|
||||
'post_type' => 'attachment',
|
||||
'post_mime_type' => 'image',
|
||||
'post_status' => 'inherit',
|
||||
'posts_per_page' => - 1,
|
||||
//'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
|
||||
);
|
||||
$query_images = new WP_Query($query_images_args);
|
||||
//var_dump($query_images);
|
||||
?>
|
||||
|
||||
<div class="content">
|
||||
<div class="container">
|
||||
<div class="post_content">
|
||||
<?php
|
||||
// Récupération de tous les attachments
|
||||
|
||||
$images = array();
|
||||
$coord = array();
|
||||
$exifs = array();
|
||||
|
||||
foreach ( $query_images->posts as $image ) {
|
||||
$images = wp_get_attachment_url( $image->ID );
|
||||
//var_dump($images);
|
||||
|
||||
$attribut = wp_prepare_attachment_for_js( $image->ID );
|
||||
//var_dump($attribut);
|
||||
|
||||
$photo = wp_get_attachment_metadata( $image->ID );
|
||||
$exifs = $photo['image_meta'];
|
||||
|
||||
if ((safe_array_access($exifs, 'latitude')) && (safe_array_access($exifs, 'longitude'))) {
|
||||
//if ((isset($exifs['latitude'])) && (isset($exifs['longitude']))) {
|
||||
|
||||
$lat = gps($exifs['latitude'], trim($exifs['latitude_ref']));
|
||||
$long = gps($exifs['longitude'], trim($exifs['longitude_ref']));
|
||||
/**/
|
||||
$attach = $attribut['id'];
|
||||
$caption = "";
|
||||
$capt = $attribut['caption'];
|
||||
$title = $attribut['title'];
|
||||
$alt = $attribut['alt'];
|
||||
$image = $attribut['url'];
|
||||
$description = $attribut['description'];
|
||||
$thumbnail = $attribut['sizes']['thumbnail'];
|
||||
//$thumbnail = '<img src="' . $thumbnail['url'] . '" alt="' . $attribut['alt'] . '" height="' . $thumbnail['height'] . '" width="' . $thumbnail['width'] . '" />';
|
||||
$thumbnailWiki = '<img id="lettrineImage" src="' . $thumbnail['url'] . '" alt="' . $attribut['alt'] . '" height="' . $thumbnail['height'] . '" width="' . $thumbnail['width'] . '" />';
|
||||
//echo $thumbnail;
|
||||
/*
|
||||
array (size=4)
|
||||
'thumbnail' =>
|
||||
array (size=4)
|
||||
'height' => int 200
|
||||
'width' => int 200
|
||||
'url' => string 'http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-06-24_LaPleureuse-LaSauffaz_0729-200x200.jpg' (length=111)
|
||||
'orientation' => string 'landscape' (length=9)
|
||||
*/
|
||||
// ??????
|
||||
$gallery[] = $attach;
|
||||
/*
|
||||
if ($capt != "") $caption = $capt;
|
||||
elseif ($title != "") $caption = $title;
|
||||
*/
|
||||
|
||||
if ($capt != "") {
|
||||
$caption = $capt;
|
||||
$requete_wiki = trim(supp_entre_parenth($capt));
|
||||
}
|
||||
elseif ($title != "") {
|
||||
$caption = $title;
|
||||
$requete_wiki = trim(clean_photo_name($title));
|
||||
}
|
||||
|
||||
// On crée le tableau $coord qui regroupe toutes les données pour le waypoint (lat,long, titre, n° attachment, description, vignette)
|
||||
|
||||
//array_push($coord, array(number_format($lat, 6), number_format($long, 6), $caption, $attach, $description, $thumbnail));
|
||||
array_push($coord, array(number_format($lat, 6), number_format($long, 6), $caption, $attach, $description, $thumbnailWiki, $requete_wiki));
|
||||
|
||||
} //if
|
||||
} //foreach
|
||||
|
||||
// On crée la galerie
|
||||
|
||||
$html5 = current_theme_supports( 'html5', 'gallery' );
|
||||
$html5 = false;
|
||||
|
||||
$galerie = array(
|
||||
'ids' => $gallery,
|
||||
'itemtag' => $html5 ? 'figure' : 'dl',
|
||||
'icontag' => $html5 ? 'div' : 'dt',
|
||||
'captiontag' => $html5 ? 'figcaption' : 'dd',
|
||||
'columns' => 3,
|
||||
'size' => 'thumbnail',
|
||||
'link' => 'file' // file - none - ''
|
||||
//'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
|
||||
);
|
||||
|
||||
$gal = mapgallery($galerie);
|
||||
echo $gal;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
// Affichage de la Carte
|
||||
|
||||
if (count($coord) > 0) {
|
||||
|
||||
//echo "avant requete Wikipedia";
|
||||
//var_dump($coord);
|
||||
/*
|
||||
0 =>
|
||||
array (size=6)
|
||||
0 => string '46.012405' (length=9)
|
||||
1 => string '6.758742' (length=8)
|
||||
2 => string 'Cascades de la Pleureuse et de la Sauffaz' (length=41)
|
||||
3 => int 70
|
||||
4 => string 'Description' (length=11)
|
||||
5 => string '<img id=\"lettrineImage\" src=\"http://macbook-pro.local/wordpress/wp-content/uploads/2017/01/2016-06-24_LaPleureuse-LaSauffaz_0729-200x200.jpg\" alt=\"cascade\" height=\"200\" width=\"200\" />' (length=193)
|
||||
*/
|
||||
$b = array();
|
||||
|
||||
// Avec tous les titres, on crée la requete pour Wikipédia
|
||||
|
||||
for ($a = 0; $a < count($coord); $a++){
|
||||
$short = $coord[$a][6]; // Titre
|
||||
$b[] = $short;
|
||||
}
|
||||
|
||||
$wiki = fmulticurl($b);
|
||||
|
||||
//On rajoute à $coord les données récupérées sur Wikipédia
|
||||
|
||||
if (count($coord) == count($wiki)) {
|
||||
for ($c = 0; $c < count($wiki); $c++){
|
||||
array_push($coord[$c], $wiki[$c][1][0], $wiki[$c][2][0], $wiki[$c][3][0]);
|
||||
}
|
||||
}
|
||||
|
||||
//echo "après requete Wikipedia";
|
||||
//var_dump($coord);
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery(document).ready(function ($) { // wait until the document is ready
|
||||
data = false;
|
||||
|
||||
$('button#showmap').click(function(){
|
||||
if (data == false) {
|
||||
$.ajax({
|
||||
url: "http://maps.googleapis.com/maps/api/js?key=AIzaSyB7cAx3NSH4dPM3Sx2oQeud7Zr-KaGXmLk&sensor=false&callback=MapApiLoaded",
|
||||
dataType: "script",
|
||||
timeout:8000,
|
||||
success: function(data) {
|
||||
// Run the code here that needs
|
||||
// to access the data returned
|
||||
data = true;
|
||||
return data;
|
||||
},
|
||||
error: function() {
|
||||
alert('Error occured');
|
||||
}
|
||||
});
|
||||
}
|
||||
$( "#locations" ).toggle( "fast");
|
||||
|
||||
$( "button#hidemap" ).show();
|
||||
$( "button#showmap" ).hide();
|
||||
$( "i.ion-ios-location" ).show();
|
||||
|
||||
}); // button#showmap
|
||||
|
||||
$('button#hidemap').click(function(){
|
||||
$( "#locations" ).toggle( "fast");
|
||||
$( "button#hidemap" ).hide();
|
||||
$( "button#showmap" ).show();
|
||||
$( "i.ion-ios-location" ).hide();
|
||||
data = true;
|
||||
});
|
||||
|
||||
}); // jQuery
|
||||
|
||||
var map;
|
||||
var markers = [];
|
||||
var cnt;
|
||||
|
||||
var locations = [
|
||||
<?php
|
||||
$j = (count($coord) - 1);
|
||||
for ($i = 0; $i <= $j; $i++) {
|
||||
//echo "['<h1>" . $coord[$i][2] . "</h1>','<p>" . $coord[$i][4] . "</p>', " . $coord[$i][0] . ", " . $coord[$i][1] . ",'" . $coord[$i][5] . "','" . $coord[$i][7] . "','" . $coord[$i][8] . "']" . (($i<$j) ? "," : "")."\r\n";
|
||||
|
||||
|
||||
echo "['<h1>" . addslashes($coord[$i][2]) . "</h1>','<p>" . addslashes($coord[$i][4]) . "</p>', " . $coord[$i][0] . ", " . $coord[$i][1] . ",'" . addslashes($coord[$i][5]) . "','" . addslashes($coord[$i][8]) . "','" . $coord[$i][9] . "']" . (($i<$j) ? "," : "")."\r\n";
|
||||
}
|
||||
//array_push($coord, array(number_format($lat, 6), number_format($long, 6), $caption, $attach, $description, $thumbnail));
|
||||
|
||||
/*
|
||||
locations[0] => $coord[2] => Titre (court)
|
||||
locations[1] => $coord[4] => Description (long)
|
||||
locations[2] => $coord[0] => Latitude
|
||||
locations[3] => $coord[1] => Longitude
|
||||
locations[4] => $coord[5] => <img "letrine">
|
||||
locations[5] => $coord[8] => Texte Wikipedia
|
||||
locations[6] => $coord[9] => Liens vers Wikipedia
|
||||
$coord[3] => attachment
|
||||
$coord[6] => requete wiki ->
|
||||
$coord[7] => <- requete wiki
|
||||
*/
|
||||
|
||||
?>
|
||||
];
|
||||
|
||||
var wikiLink = '';
|
||||
var contenuInfoBulle = [];
|
||||
|
||||
|
||||
function MapApiLoaded() {
|
||||
|
||||
// Setup the different icons and shadows
|
||||
var iconURLPrefix = 'https://maps.google.com/mapfiles/ms/icons/';
|
||||
|
||||
var root = location.protocol + '//' + location.host;
|
||||
var wikiImg = root + '/wordpress/wp-content/themes/CreatorThemeRes-child/images/wikipedia.png';
|
||||
var wikiUrl = '<img src=\"' + wikiImg + '\" width=\"32\" height=\"32\" class=\"wiki\" />';
|
||||
|
||||
var icons = [
|
||||
iconURLPrefix + 'red-dot.png',
|
||||
iconURLPrefix + 'green-dot.png',
|
||||
iconURLPrefix + 'blue-dot.png',
|
||||
iconURLPrefix + 'orange-dot.png',
|
||||
iconURLPrefix + 'purple-dot.png',
|
||||
iconURLPrefix + 'pink-dot.png',
|
||||
iconURLPrefix + 'yellow-dot.png'
|
||||
]
|
||||
var iconsLength = icons.length;
|
||||
|
||||
// Create google map
|
||||
map = new google.maps.Map($('#gmap')[0], {
|
||||
zoom:8,
|
||||
mapTypeId:google.maps.MapTypeId.ROADMAP,
|
||||
panControl:false,
|
||||
streetViewControl:false,
|
||||
mapTypeControl:true
|
||||
});
|
||||
|
||||
infowindow = new google.maps.InfoWindow();
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
var iconCounter = 0;
|
||||
for (i = 0; i < locations.length; i++) {
|
||||
marker = new google.maps.Marker({
|
||||
position: new google.maps.LatLng(locations[i][2], locations[i][3]),
|
||||
map: map,
|
||||
icon: icons[iconCounter],
|
||||
title: locations[i][0]
|
||||
});
|
||||
|
||||
markers.push(marker);
|
||||
|
||||
|
||||
if (locations[i][6] != '') {
|
||||
wikiLink = '<a href=\"' + locations[i][6] + '\" title=\"Plus sur Wikipedia...\">' + wikiUrl + '</a>';
|
||||
}
|
||||
contenuInfoBulle[i] = locations[i][0] + locations[i][4] + locations[i][1] + locations[i][5] + '<br />' + wikiLink;
|
||||
/*
|
||||
locations[0] => $coord[2] => Titre (court)
|
||||
locations[4] => $coord[5] => <img "letrine">
|
||||
locations[1] => $coord[4] => Description (long)
|
||||
locations[5] => $coord[8] => Texte Wikipedia
|
||||
locations[6] => $coord[9] => Liens vers Wikipedia
|
||||
*/
|
||||
|
||||
var zoom = 1;
|
||||
a = map.getZoom();
|
||||
bounds.extend(marker.position);
|
||||
|
||||
// add the double-click event listener
|
||||
google.maps.event.addListener(marker, 'dblclick', function() {
|
||||
map.panTo(this.getPosition());
|
||||
//map.setZoom(9);
|
||||
if (zoom == 1) {
|
||||
if (map.getZoom() < (a + 6)) {
|
||||
map.setZoom(map.getZoom() + 2);
|
||||
}
|
||||
else zoom = 0;
|
||||
}
|
||||
else if (zoom == 0) {
|
||||
if (map.getZoom() >= a) {
|
||||
map.setZoom(map.getZoom() - 2);
|
||||
}
|
||||
else zoom = 1;
|
||||
}
|
||||
});
|
||||
|
||||
/*https://www.touraineverte.fr/google-maps-api-version-3/exemple-tutoriel-infobulles-infowindows/ajouter-infowindow-infobulle-marqueur-defaut-api-google-maps-version-3.html*/
|
||||
|
||||
google.maps.event.addListener(marker, 'mousemove', (function (marker, i) {
|
||||
return function () {
|
||||
|
||||
/*
|
||||
var wikiLink = '';
|
||||
if (locations[i][6] != '') {
|
||||
wikiLink = '<a href=\"' + locations[i][6] + '\" title=\"Plus sur Wikipedia...\">' + wikiUrl + '</a>';
|
||||
}
|
||||
|
||||
//var contenuInfoBulle = locations[i][0] + locations[i][4] + locations[i][5] + '<br />' + wikiLink;
|
||||
var contenuInfoBulle = locations[i][0] + locations[i][4] + locations[i][1] + locations[i][5] + '<br />' + wikiLink;
|
||||
*/
|
||||
|
||||
infowindow.setContent(contenuInfoBulle[i]);
|
||||
infowindow.open(map, marker);
|
||||
}
|
||||
})(marker, i));
|
||||
|
||||
iconCounter++;
|
||||
if (iconCounter >= iconsLength) {
|
||||
iconCounter = 0;
|
||||
}
|
||||
|
||||
} // for
|
||||
|
||||
map.fitBounds(bounds);
|
||||
|
||||
} //MapApiLoaded
|
||||
|
||||
function jumpToMarker(cnt){
|
||||
|
||||
map.panTo(markers[cnt].getPosition());
|
||||
if (map.getZoom() < 15) {
|
||||
map.setZoom(a + 4);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
infowindow.setContent(contenuInfoBulle[cnt]);
|
||||
infowindow.open(map, markers[cnt]);
|
||||
}, 300);
|
||||
} //jumpToMarker
|
||||
|
||||
</script>
|
||||
|
||||
<div id="locations">
|
||||
<div id="gmap" style="width: 800px; height: 600px; border:1px solid #999;" class="aligncenter"></div>
|
||||
|
||||
<?php
|
||||
$j = (count($coord) - 1);
|
||||
echo "<div id='center_marker'><ul class='list_marker'>";
|
||||
for ($i = 0; $i <= $j; $i++) {
|
||||
//<a href="javascript:void(0);" onclick="jumpToMarker(4)" class="button3">PontDArc</a>
|
||||
echo "<li><i class='ion-ios-location'></i><a href='#gmap' onclick='jumpToMarker(" . $i . ")'>" . $coord[$i][2] . "</a></li>";
|
||||
//echo "<li><i class='ion-ios-location'></i><a href='javascript:void(0);' onclick='jumpToMarker(" . $i . ")'>" . $coord[$i][2] . "</a></li>";
|
||||
}
|
||||
echo "</ul></div>";
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<button type="button" id="showmap"><?php _e('Show map','CreatorThemeRes-child'); ?></button>
|
||||
<button type="button" id="hidemap"><?php _e('Hide map','CreatorThemeRes-child'); ?></button>
|
||||
|
||||
<?php
|
||||
|
||||
} // if count
|
||||
|
||||
/*
|
||||
$photo
|
||||
|
||||
array (size=5)
|
||||
'width' => int 1600
|
||||
'height' => int 1067
|
||||
'file' => string '2017/01/2016-06-24_LaPleureuse-LaSauffaz_0729.jpg' (length=49)
|
||||
'sizes' =>
|
||||
array (size=3)
|
||||
'thumbnail' =>
|
||||
array (size=4)
|
||||
'file' => string '2016-06-24_LaPleureuse-LaSauffaz_0729-200x200.jpg' (length=49)
|
||||
'width' => int 200
|
||||
'height' => int 200
|
||||
'mime-type' => string 'image/jpeg' (length=10)
|
||||
'medium' =>
|
||||
array (size=4)
|
||||
'file' => string '2016-06-24_LaPleureuse-LaSauffaz_0729-800x534.jpg' (length=49)
|
||||
'width' => int 800
|
||||
'height' => int 534
|
||||
'mime-type' => string 'image/jpeg' (length=10)
|
||||
'large' =>
|
||||
array (size=4)
|
||||
'file' => string '2016-06-24_LaPleureuse-LaSauffaz_0729-1180x787.jpg' (length=50)
|
||||
'width' => int 1180
|
||||
'height' => int 787
|
||||
'mime-type' => string 'image/jpeg' (length=10)
|
||||
'image_meta' =>
|
||||
array (size=16)
|
||||
'aperture' => string '14' (length=2)
|
||||
'credit' => string '' (length=0)
|
||||
'camera' => string 'Canon EOS 5D Mark III' (length=21)
|
||||
'caption' => string '' (length=0)
|
||||
'created_timestamp' => string '1466758515' (length=10)
|
||||
'copyright' => string '' (length=0)
|
||||
'focal_length' => string '17' (length=2)
|
||||
'iso' => string '100' (length=3)
|
||||
'shutter_speed' => string '0.04' (length=4)
|
||||
'title' => string '' (length=0)
|
||||
'orientation' => string '1' (length=1)
|
||||
'keywords' =>
|
||||
array (size=5)
|
||||
0 => string 'France' (length=6)
|
||||
1 => string 'Haute-Savoie' (length=12)
|
||||
2 => string 'Rhone-Alpes' (length=11)
|
||||
3 => string 'cascade de la Pleureuse' (length=23)
|
||||
4 => string 'cascade de la Sauffaz' (length=21)
|
||||
'latitude' =>
|
||||
array (size=3)
|
||||
0 => string '46/1' (length=4)
|
||||
1 => string '7443/10000' (length=10)
|
||||
2 => string '0/1' (length=3)
|
||||
'latitude_ref' => string 'N' (length=1)
|
||||
'longitude' =>
|
||||
array (size=3)
|
||||
0 => string '6/1' (length=3)
|
||||
1 => string '455245/10000' (length=12)
|
||||
2 => string '0/1' (length=3)
|
||||
'longitude_ref' => string 'E' (length=1)
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer('page');
|
||||
?>
|
||||