// --------------------------------------------------------------------------
// Foto-Webcam.eu
// Render full-sized image in a maximum size window with scrolling
//
// Flori Radlherr, http://www.radlherr.de
// This is free software, see COPYING for details.
// --------------------------------------------------------------------------
//
require "common.php";
$img= "/".$webcam['parImg']."_hu.jpg";
$imgUri= $webcam['workUri'].$img;
$imgPath= $webcam['workPath'].$img;
$inc= $webcam['includeUri'];
// ----------------------------------------------------------------------------
// Read actual image size to have the correct rectangle
$imageWidth= 4272;
$imageHeight= 2848;
$size= @getimagesize($imgPath);
/*if (isset($size)) {
$imageWidth= $size[0];
$imageHeight= $size[1];
}
else {
$imageWidth= $webcam['hugeWidth'];
$imageHeight= $webcam['hugeHeight'];
if ($mysqli= openMysql()) {
$res= $mysqli->query("select hu_width,hu_height from webcam_image ".
"where cam='".$webcam['name']."' and path='".$webcam['parImg']."'");
if ($res && $row= $res->fetch_assoc()) {
if ($row['hu_width']>0) {
$imageWidth= $row['hu_width'];
}
if ($row['hu_height']>0) {
$imageHeight= $row['hu_height'];
}
$res->free();
}
}
}*/
// ----------------------------------------------------------------------------
// Avoid deep links into fullscreen image
$regularUrl= "http://$currentHost".$webcam['workUri']."/#/".$webcam['parImg'];
$frameOk= "xxx";
if (isset($webcam["frameOk"])) {
$frameOk= $webcam["frameOk"];
}
if (isset($_SERVER['HTTP_REFERER'])) {
$ref= $_SERVER['HTTP_REFERER'];
if (strlen($ref)>5) {
if (!strstr($ref,$currentHost) && !preg_match("/$frameOk/", $ref)) {
Header("302 Moved");
Header("Location: $regularUrl");
exit();
}
}
}
// ----------------------------------------------------------------------------
// Localisation
$msgFit= "fitscreen.png";
$msgFitT= "Fit image to screen size (Key F)";
$msgTitle= "View webcam image with full resulution";
$msgMove= "Move mouse to scroll image
".
"Click or Esc to close window";
$msgZoom= "Mouse-wheel or keys +/- zoom the image - Key 0: original size";
if ($lang == "de") {
$msgFit= "anpassen.png";
$msgFitT= "Zeige gesamtes Bild im Fenster (Taste F)";
$msgTitle= "Webcam-Bild in voller Auflösung";
$msgMove= "Maus bewegen, um Bild zu scrollen
".
"Klick bzw. Esc schließt das Fenster";
$msgZoom= "Mausrad oder Taste +/- zoomt das Bild - Taste 0: Originalgröße";
}
// ----------------------------------------------------------------------------
print <<
$msgTitle
END;
// ----------------------------------------------------------------------------
$ua= $_SERVER['HTTP_USER_AGENT'];
if (preg_match("/(symbian|mobile|fennec|android|iphone|ipad|touch)/i", $ua)) {
print <<
END;
exit;
}
// ----------------------------------------------------------------------------
print <<
#img {
width: ${imageWidth}px; height: ${imageHeight}px;
}
#div {
position: fixed;
z-index: 0;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
}
#help {
position: fixed;
z-index: 2;
opacity: 0.6;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
top: 0;
right: 0;
background-color: white;
color: black;
font-size: 13px;
text-align: right;
padding: 2px;
}
#zoom {
position: fixed;
z-index: 2;
opacity: 0.6;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
top: 0;
left: 0;
background-color: white;
color: black;
font-size: 13px;
text-align: right;
padding: 2px;
}
#showframe {
position: fixed;
z-index: 2;
bottom: 0;
right: 0;
opacity: 0.3;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
background-color: white;
}
#showpos {
position: fixed;
z-index: 3;
opacity: 0.5;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
background-color: white;
}
#fullpic {
display: block;
position: fixed;
z-index: 3;
bottom: 0;
left: 0;
opacity: 0.2;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
cursor: pointer;
}
body {
background-color: black;
}
$msgMove
ENDX;