Option to not expand images
Status: Beta
Brought to you by:
pappkamerad
I'd enjoy an option that said do not expand images,
only shrink. So if you have an 800x600 picture, the
view option will be (assuming the defaults,
640,800,1024) the options will only be 640x480,
800x600, and original. If you had a picture say,
500x300, the only option available would be original.
In conjunction with my other feature request... I guess
from a large image to the smaller one, the next would
fall back to that image size or the closest one below it :)
Logged In: YES
user_id=1276995
Okay...Edit the below in your files. I'm not sure what I'm
doing wrong but it adds the | line if you have Original
disabled. (I don't have it disabled so I really don't care
to much) This should only show links to images that are
smaller then the original width.
Peace,
MrTorrance
____________________________________________________
WRAPPER.PHP:
//generate view size links
$view_size_links = array();
$i = 0;
foreach ($cfg['view_sizes'] as $view_size => $view_width) {
if (((isset($_GET['size']) && $_GET['size'] ==
$view_size) || (!isset($_GET['size']) && $view_size ==
$cfg['default_view'])) && $_GET['orig'] != 1) {
$view_size_links[$i]['href'] = '';
if($current_picture['info']['width'] >= $view_width)
{
$view_size_links[$i]['name'] =
utf8_encode($cfg['view_sizes'][$view_size]);
}
else {
$view_size_links[$i]['name'] = "";
}
$pn_size = $i; // NEW LINE
}
else {
if($current_picture['info']['width'] >= $view_width)
{
$view_size_links[$i]['href'] =
utf8_encode($web_pAG_path_rel . $web_current_path . $file ).
'?size=' . $view_size . '&offset=' . $_GET['offset'];
$view_size_links[$i]['name'] =
utf8_encode($cfg['view_sizes'][$view_size]);
}
else {
$view_size_links[$i]['href'] = "";
$view_size_links[$i]['name'] = "";
}
}
$i++;
}
_______________________________________________
VIEWPIC.TPL:
View size:
{section name=i loop=$arrViewSizeLinks}
{if $arrViewSizeLinks[i].href != ""}
<a
href="{$arrViewSizeLinks[i].href}">{$arrViewSizeLinks[i].name}</a>
{else}
<b>{$arrViewSizeLinks[i].name}</b>
{/if}
{if $arrViewSizeLinks[i].name != '' ||
$arrViewOriginalLink.allowed == 1 &&
$arrViewSizeLinks[i].name != '' }
|
{/if}
{/section}
__________________________________________