-
Notifications
You must be signed in to change notification settings - Fork 2
/
exif.php
133 lines (119 loc) · 4.95 KB
/
exif.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
use Xmf\Request;
use XoopsModules\Tadtools\Utility;
/*-----------引入檔案區--------------*/
require __DIR__ . '/header.php';
$xoopsLogger->activated = false;
$exif_item['Make'] = _MD_TADGAL_MAKE;
$exif_item['Model'] = _MD_TADGAL_MODEL;
//$exif_item['Orientation']=_MD_TADGAL_ORIENTATION;
$exif_item['xResolution'] = _MD_TADGAL_XRESOLUTION;
$exif_item['yResolution'] = _MD_TADGAL_YRESOLUTION;
$exif_item['ResolutionUnit'] = _MD_TADGAL_RESOLUTIONUNIT;
$exif_item['YCbCrPositioning'] = _MD_TADGAL_YCBCRPOSITIONING;
$exif_item['ExifOffset'] = _MD_TADGAL_EXIFOFFSET;
$exif_item['ExposureTime'] = _MD_TADGAL_EXPOSURETIME;
$exif_item['FNumber'] = _MD_TADGAL_FNUMBER;
$exif_item['ExposureProgram'] = _MD_TADGAL_EXPOSUREPROGRAM;
$exif_item['ISOSpeedRatings'] = _MD_TADGAL_ISOSPEEDRATINGS;
$exif_item['ExifVersion'] = _MD_TADGAL_EXIFVERSION;
$exif_item['DateTimeOriginal'] = _MD_TADGAL_DATETIMEORIGINAL;
$exif_item['DateTimedigitized'] = _MD_TADGAL_DATETIMEDIGITIZED;
$exif_item['ComponentsConfiguration'] = _MD_TADGAL_COMPONENTSCONFIGURATION;
$exif_item['ShutterSpeedValue'] = _MD_TADGAL_SHUTTERSPEEDVALUE;
$exif_item['ApertureValue'] = _MD_TADGAL_APERTUREVALUE;
$exif_item['ExposureBiasValue'] = _MD_TADGAL_EXPOSUREBIASVALUE;
$exif_item['MaxApertureValue'] = _MD_TADGAL_MAXAPERTUREVALUE;
$exif_item['MeteringMode'] = _MD_TADGAL_METERINGMODE;
$exif_item['Flash'] = _MD_TADGAL_FLASH;
$exif_item['FocalLength'] = _MD_TADGAL_FOCALLENGTH;
$exif_item['FlashPixVersion'] = _MD_TADGAL_FLASHPIXVERSION;
$exif_item['ColorSpace'] = _MD_TADGAL_COLORSPACE;
$exif_item['ExifImageWidth'] = _MD_TADGAL_EXIFIMAGEWIDTH;
$exif_item['ExifImageHeight'] = _MD_TADGAL_EXIFIMAGEHEIGHT;
$exif_item['ExifInteroperabilityOffset'] = _MD_TADGAL_EXIFINTEROPERABILITYOFFSET;
$exif_item['ExposureIndex'] = _MD_TADGAL_EXPOSUREINDEX;
$exif_item['SensingMethod'] = _MD_TADGAL_SENSINGMETHOD;
$exif_item['FileSource'] = _MD_TADGAL_FILESOURCE;
$exif_item['SceneType'] = _MD_TADGAL_SCENETYPE;
$exif_item['ExposureMode'] = _MD_TADGAL_EXPOSUREMODE;
$exif_item['WhiteBalance'] = _MD_TADGAL_WHITEBALANCE;
$exif_item['DigitalZoomRatio'] = _MD_TADGAL_DIGITALZOOMRATIO;
$exif_item['SceneCaptureMode'] = _MD_TADGAL_SCENECAPTUREMODE;
$exif_item['GainControl'] = _MD_TADGAL_GAINCONTROL;
$exif_item['Contrast'] = _MD_TADGAL_CONTRAST;
$exif_item['Saturation'] = _MD_TADGAL_SATURATION;
$exif_item['Sharpness'] = _MD_TADGAL_SHARPNESS;
$exif_item['Compression'] = _MD_TADGAL_COMPRESSION;
//$exif_item['Orientation']=_MD_TADGAL_ORIENTATION;
$exif_item['xResolution'] = _MD_TADGAL_XRESOLUTION;
$exif_item['yResolution'] = _MD_TADGAL_YRESOLUTION;
$exif_item['ResolutionUnit'] = _MD_TADGAL_RESOLUTIONUNIT;
$exif_item['JpegIFOffset'] = _MD_TADGAL_JPEGIFOFFSET;
$exif_item['JpegIFByteCount'] = _MD_TADGAL_JPEGIFBYTECOUNT;
$exif_item['FileName'] = _MD_TADGAL_FILENAME;
//$exif_item['FileType']=_MD_TADGAL_FILETYPE;
$exif_item['MimeType'] = _MD_TADGAL_MIMETYPE;
$exif_item['FileSize'] = _MD_TADGAL_FILESIZE;
$exif_item['Width'] = _MD_TADGAL_WIDTH;
$exif_item['Height'] = _MD_TADGAL_HEIGHT;
$exif_item['ApertureFNumber'] = _MD_TADGAL_APERTUREFNUMBER;
$exif_item['Longitude'] = _MD_TADGAL_LONGITUDE;
$exif_item['Latitude'] = _MD_TADGAL_LATITUDE;
$exif_item['GPSMapDatum'] = _MD_TADGAL_GPSMAPDATUM;
$exif_item['GPSSatellites'] = _MD_TADGAL_GPSSATELLITES;
$exif_item['GPSStatus'] = _MD_TADGAL_GPSSTATUS;
$exif_item['GPSMeasureMode'] = _MD_TADGAL_GPSMEASUREMODE;
$exif_item['GPSDOP'] = _MD_TADGAL_GPSDOP;
$exif_item['GPSDateStamp'] = _MD_TADGAL_GPSDATESTAMP;
/*-----------function區--------------*/
function get_exif_info($item = '', $v = '')
{
global $exif_item;
$v = trim($v);
if (empty($v)) {
return;
}
$main = '';
if (!empty($exif_item[$item])) {
$main = "<tr><td>{$exif_item[$item]} ($item) </td><td>{$v}</td></tr>";
}
return $main;
}
//觀看某一張照片
function view_pic_exif($sn = '')
{
global $xoopsDB;
$sql = 'SELECT `exif` FROM `' . $xoopsDB->prefix('tad_gallery') . '` WHERE `sn`=?';
$result = Utility::query($sql, 'i', [$sn]) or Utility::web_error($sql, __FILE__, __LINE__);
list($exif) = $xoopsDB->fetchRow($result);
$photoexif = parse_exif_string($exif);
$exif_all = $exif_data = '';
foreach ($photoexif as $k => $v) {
$exif_data = '';
foreach ($v as $kk => $vv) {
$exif_data .= get_exif_info($kk, $vv);
}
if (!empty($exif_data)) {
$exif_all .= $exif_data;
}
}
return "<table style='width:auto;' class='line'>$exif_all</table>";
}
/*-----------執行動作判斷區----------*/
$sn = Request::getInt('sn');
$main = view_pic_exif($sn);
/*-----------秀出結果區--------------*/
echo '<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EXIF</title>
<link rel="stylesheet" type="text/css" media="screen" href="' . XOOPS_URL . '/modules/tadgallery/css/module.css">
</head>
<body>
<h3 class="sr-only visually-hidden">EXIF</h3>
' . $main . '
</body>
</html>';