Optimize scaleImage returns

This commit is contained in:
Ian 2015-10-19 13:21:19 +02:00
parent ecd3ba5a10
commit 715d8cafa6
4 changed files with 25 additions and 12 deletions

View File

@ -1,6 +1,8 @@
Version 2.1 () Version 2.1 ()
------------------------------------------------------------------------ ------------------------------------------------------------------------
* Optimize scaleImage returns
* Fixed media item rename handler (#370) * Fixed media item rename handler (#370)
* Fixed and enhanced multiple media redirects and path / name * Fixed and enhanced multiple media redirects and path / name

View File

@ -675,15 +675,25 @@ switch ($serendipity['GET']['adminAction']) {
return; return;
} }
$data['case_scale'] = true; $data['case_scale'] = true; // this allows to use the showML fallback too
$data['print_SCALING_IMAGE'] = sprintf( if ($serendipity['GET']['width'] == $file['dimensions_width'] && $serendipity['GET']['height'] == $file['dimensions_height']) {
SCALING_IMAGE, $data['messages'] = '<span class="msg_notice"><span class="icon-info-circled"></span> ' . MEDIA_RESIZE_EXISTS . '</span>';
$file['path'] . $file['name'] .'.'. $file['extension'], } else {
(int)$serendipity['GET']['width'], $data['print_SCALING_IMAGE'] = sprintf(
(int)$serendipity['GET']['height'] SCALING_IMAGE,
); $file['path'] . $file['name'] .'.'. $file['extension'],
$data['extraParems'] = serendipity_generateImageSelectorParems(); (int)$serendipity['GET']['width'],
$data['print_serendipity_scaleImg'] = serendipity_scaleImg($serendipity['GET']['fid'], $serendipity['GET']['width'], $serendipity['GET']['height']); (int)$serendipity['GET']['height']
);
$data['extraParems'] = serendipity_generateImageSelectorParems();
$scaleImg = serendipity_scaleImg($serendipity['GET']['fid'], $serendipity['GET']['width'], $serendipity['GET']['height']);
if (!empty($scaleImg) && is_string($scaleImg)) {
$data['scaleImgError'] = $scaleImg;
}
$data['is_done'] = true;
}
// fall back
$data['showML'] = showMediaLibrary();
break; break;
case 'scaleSelect': case 'scaleSelect':

View File

@ -7,3 +7,4 @@
@define('MEDIA_PROPERTIES_DONE', 'Properties of #%d changed.'); @define('MEDIA_PROPERTIES_DONE', 'Properties of #%d changed.');
@define('DIRECTORY_INFO', 'Directory info helper'); @define('DIRECTORY_INFO', 'Directory info helper');
@define('DIRECTORY_INFO_DESC', 'Directories are based to their physical folder directory name. If you want to change or move directories with items, you have two choices. Either create the directory or subdirectory you want, then move the items to the new directory via the MediaLibrary and after all, delete the now emptied old directory here. Or edit the old directory via the edit directory button below and rename it to whatever you like (existing subdir/ +) newname. This will move all directories and items and rename entry path too.'); @define('DIRECTORY_INFO_DESC', 'Directories are based to their physical folder directory name. If you want to change or move directories with items, you have two choices. Either create the directory or subdirectory you want, then move the items to the new directory via the MediaLibrary and after all, delete the now emptied old directory here. Or edit the old directory via the edit directory button below and rename it to whatever you like (existing subdir/ +) newname. This will move all directories and items and rename entry path too.');
@define('MEDIA_RESIZE_EXISTS', 'File dimensions already exist!');

View File

@ -237,9 +237,9 @@
{/if} {/if}
{/if} {/if}
{if $case_scale} {if $case_scale}
{if $print_SCALING_IMAGE}<span class="msg_notice"><span class="icon-info-circled"></span> {$print_SCALING_IMAGE}</span>{/if} {if isset($print_SCALING_IMAGE)}<span class="msg_notice"><span class="icon-info-circled"></span> {$print_SCALING_IMAGE}</span>{/if}
{if $print_serendipity_scaleImg}<span class="msg_notice"><span class="icon-info-circled"></span> {$print_serendipity_scaleImg}</span>{/if} {if isset($scaleImgError)}<span class="msg_error"><span class="icon-attention-circled"></span> {$scaleImgError}</span>{/if}
<span class="msg_notice"><span class="icon-info-circled"></span> {$CONST.DONE}</span> {if isset($is_done)}<span class="msg_success"><span class="icon-ok-circled"></span> {$CONST.DONE}</span>{/if}
{if $showML}{$showML}{/if} {if $showML}{$showML}{/if}
{/if} {/if}
{if $case_scaleSelect} {if $case_scaleSelect}