Location: PHPKode > projects > Kwalbum > kwalbum/ajax/getJpegExifData.php
<?php
/* 2.0
 * Created on Sep 24, 2008
 */
$includePath = pathinfo(__FILE__, PATHINFO_DIRNAME).'/../include/';
require_once $includePath.'verifyLogin.php';
require_once $includePath.'DBConnection.php';
require_once $includePath.'pjmt/EXIF.php';

$GLOBALS['HIDE_UNKNOWN_TAGS'] = true;
$DB = new DBConnection();
$id = (int)@$P['id'];

$query = 'SELECT ItemPath, ItemFilename, ItemIsHidden FROM ' . ITEM_TABLE .
	" WHERE ItemId='$id'";
$result = $DB->Query($query);

if (0 == $result->num_rows)
{
	echo '<p class="error">Item ID ('.$id.') was not found in the DB.</p>';
	exit;
}
$row = $result->fetch_array();
if ((1 == $row[2] and !USER_ID) or (2 == $row[2] and !USER_CAN_VIEW) or (2 < $row[2] and !USER_IS_ADMIN))
{
	echo '<p class="error">Invalid Permissions</p>';
	exit;
}
$filename = PICS_PATH.$row[0].$row[1];
if (!$data = get_EXIF_JPEG($filename))
	echo 'No EXIF Data Found<br/>';
else
	echo Interpret_EXIF_to_HTML($data, $filename);
if (!$data = get_Meta_JPEG($filename))
	echo 'No Meta Data Found<br/>';
else
	echo Interpret_EXIF_to_HTML($data, $filename);
$jpeg_header_data = get_jpeg_header_data( $filename );
if ($irb = get_Photoshop_IRB( $jpeg_header_data ))
	echo Interpret_IRB_to_HTML($irb, $filename );
Return current item: Kwalbum