2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
//
|
|
|
|
// ZoneMinder web feed file, $Date$, $Revision$
|
|
|
|
// Copyright (C) 2003 Philip Coombes
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
//
|
|
|
|
|
|
|
|
$result = mysql_query( "select * from Monitors where Id = '$mid'" );
|
|
|
|
if ( !$result )
|
|
|
|
die( mysql_error() );
|
|
|
|
$monitor = mysql_fetch_assoc( $result );
|
|
|
|
$browser = array();
|
|
|
|
$browser['Width'] = 100;
|
|
|
|
$browser['Height'] = 80;
|
|
|
|
|
|
|
|
// Generate an image
|
|
|
|
chdir( ZM_DIR_IMAGES );
|
|
|
|
$status = exec( escapeshellcmd( ZMU_PATH." -m $mid -i" ) );
|
|
|
|
$monitor_image = $monitor['Name'].".jpg";
|
|
|
|
$image_time = filemtime( $monitor_image );
|
|
|
|
$browser_image = $monitor['Name']."-wap-$image_time.jpg";
|
|
|
|
$command = ZM_PATH_NETPBM."/jpegtopnm -dct fast $monitor_image | ".ZM_PATH_NETPBM."/pnmscale -xysize ".$browser['Width']." ".$browser['Height']." | ".ZM_PATH_NETPBM."/ppmtojpeg > $browser_image";
|
|
|
|
exec( $command );
|
|
|
|
chdir( '..' );
|
2003-07-11 17:27:56 +08:00
|
|
|
|
|
|
|
?>
|
|
|
|
<wml>
|
2004-01-08 18:09:35 +08:00
|
|
|
<card id="zmFeed" title="ZM - <?= $monitor['Name'] ?>" ontimer="<?= $PHP_SELF ?>?view=<?= $view ?>&mid=<?= $mid ?>">
|
2004-04-19 19:23:40 +08:00
|
|
|
<timer value="<?= ZM_WEB_REFRESH_IMAGE*10 ?>"/>
|
2004-01-08 18:09:35 +08:00
|
|
|
<p mode="nowrap" align="center"><strong>ZM - <?= $monitor['Name'] ?></strong></p>
|
|
|
|
<p mode="nowrap" align="center"><img src="<?= ZM_DIR_IMAGES.'/'.$browser_image ?>" alt="<?= $monitor['Name'] ?>" hspace="0" vspace="0" align="middle"/></p>
|
2003-07-11 17:27:56 +08:00
|
|
|
</card>
|
|
|
|
</wml>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
flush();
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|