<?php

	global $options;
	foreach ($options as $value) {
	if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option( $value['id'] ); }
	}
$imgquality=$rm_imgquality;

if ($post->image->width > $post->image->height){
	if ($post->image->width > $rm_widthland){
		$im_dim = $rm_widthland;
	}
	else {
		$im_dim = $post->image->width;
	}
}
else {
	if ($post->image->width > $rm_widthport){
		$im_dim = $rm_widthport;
	}
	else {
		$im_dim = $post->image->width;
	}
}
	
	
//$im_dim = $post->image->width > $post->image->height ? $rm_widthland : $rm_widthport;

function get_thumbnail($removeamps=false)
{
	global $post, $im_dim, $imgquality;
	$uri = $post->image->getThumbnailHref(array('w='.$im_dim, 'q='.$imgquality));
	return $removeamps ? str_replace("&amp;", "&", $uri) : $uri;
}

function get_exif()
{
	global $post;
	
	$exif_info = yapb_get_exif();
	
	if (empty($exif_info))
		return "No EXIF information available.";
	
	$output = '<ul>';
	
	foreach ($exif_info as $k => $v)
		$output .= '<li><label>'.$k.'</label>'.$v.'</li>';
	
	return $output.'</ul>';
}

function yapb_get_exif_filter($exif) 
{
	/* Any exif filtering gets done in this function. Modify if you want it. */
	
	return $exif;
}

function init_imagesize()
{

global $post, $im_dim, $imgquality, $rm_imgquality, $rm_widthport, $rm_widthland;

   $imgquality=$rm_imgquality;

   if ($post->image->width > $post->image->height){
    if ($post->image->width > $rm_widthland){
     $im_dim = $rm_widthland;
    }
    else {
     $im_dim = $post->image->width;
    }
   }
   else {
    if ($post->image->width > $rm_widthport){
     $im_dim = $rm_widthport;
    }
    else {
     $im_dim = $post->image->width;
    }
   }
}

// Uncomment the following line to enable EXIF filtering.

//add_filter('yapb_get_exif', 'yapb_get_exif_filter');

?>
