if available when generating mini or square thumbnails? This gives a better
change that the crop will contain an interesting part of the image, but will
increase CPU usage during image generation."></configboolean>
+ <configboolean name="tiny" desc="Should Ansel use the TinySrc.mobi webservice
+ to generate mobile image screen views if appropriate? The gallery must either
+ be publicly viewable or you must be using the VFS direct option above. If
+ this is enabled, and these conditions are not met, Ansel will fall back to
+ an average sized mobile image. Note also that if you are using localhost or
+ something similar as the server name, this will fail.">false</configboolean>
<configstring name="num_uploads" desc="How many photos should a user be
allowed to upload at once?">5</configstring>
<configstring name="font" required="false" desc="What font would you like
$thumbstyle = Horde_Util::getFormData('t');
$background = Horde_Util::getFormData('b');
+$w = Horde_Util::getFormData('w');
+$h = Horde_Util::getFormData('h');
// Create a dummy style object with only what is needed to generate
-if ($thumbstyle && $background) {
+if ($thumbstyle || $background || $w || $h) {
$style = new Ansel_Style(array('thumbstyle' => $thumbstyle,
- 'background' => $background));
+ 'background' => $background,
+ 'width' => $w,
+ 'height' => $h));
} else {
$style = null;
}
if (!is_null($style)) {
$params['t'] = $style->thumbstyle;
$params['b'] = $style->background;
+ if ($style->width) {
+ $params['w'] = $style->width;
+ }
+ if ($style->height) {
+ $params['h'] = $style->height;
+ }
}
return Horde::url('img/' . $view . '.php', $full)->add($params);
}
if ($full) {
- $json->tiny = ($GLOBALS['conf']['vfs']['src'] == 'direct' || $this->hasPermission('', Horde_Perms::READ));
+ $json->tiny = ($GLOBALS['conf']['image']['tiny'] &&
+ ($GLOBALS['conf']['vfs']['src'] == 'direct' || $this->hasPermission('', Horde_Perms::READ)));
$json->sg = array();
if ($this->hasSubGalleries()) {
$sgs = $GLOBALS['injector']->getInstance('Ansel_Storage')->listGalleries(array('parent' => $this->getId(), 'all_levels' => false));
foreach ($images as $img) {
$i = new StdClass();
$i->id = $img->id;
- $i->url = Ansel::getImageUrl($img->id, 'thumb', false, Ansel::getStyleDefinition('ansel_mobile'))->toString();
- $i->screen = Ansel::getImageUrl($img->id, 'screen', $json->tiny, Ansel::getStyleDefinition('ansel_default'))->toString();
+ $i->url = Ansel::getImageUrl($img->id, 'thumb', false, Ansel::getStyleDefinition('ansel_mobile'))->toString(true);
+ $i->screen = Ansel::getImageUrl($img->id, 'screen', $json->tiny, Ansel::getStyleDefinition('ansel_default'))->toString(true);
$i->fn = $img->filename;
$json->imgs[] = $i;
}
$ansel_webroot = $registry->get('webroot');
$horde_webroot = $registry->get('webroot', 'horde');
-$has_tasks = $registry->hasInterface('tasks');
/* Variables used in core javascript files. */
$code['conf'] = array(