1
0
Fixes thumbnail regeneration, only a problem with proper execution order
This commit is contained in:
Garvin Hicking
2014-06-25 13:22:39 +02:00
parent 6b1b4f2448
commit 63f7510ebd
3 changed files with 8 additions and 5 deletions

View File

@ -4,6 +4,8 @@
Version 2.0-beta3 () Version 2.0-beta3 ()
------------------------------------------------------------------------ ------------------------------------------------------------------------
* Fixed thumbnail recreation, Issue #134
* Merged external JS libraries into a central "plugins.js" of the 2k11 * Merged external JS libraries into a central "plugins.js" of the 2k11
backend template, can be updated through backend template, can be updated through
templates/2k11/admin/js/gruntipity.php helper script. templates/2k11/admin/js/gruntipity.php helper script.

View File

@ -30,10 +30,6 @@ switch ($serendipity['GET']['adminAction']) {
} }
@ignore_user_abort(); @ignore_user_abort();
$i = serendipity_syncThumbs($deleteThumbs);
$data['print_SYNC_DONE'] = sprintf(SYNC_DONE, $i);
flush();
$deleteThumbs = false; $deleteThumbs = false;
if (isset($serendipity['POST']['deleteThumbs'])) { if (isset($serendipity['POST']['deleteThumbs'])) {
switch ($serendipity['POST']['deleteThumbs']) switch ($serendipity['POST']['deleteThumbs'])
@ -47,6 +43,10 @@ switch ($serendipity['GET']['adminAction']) {
} }
} }
$i = serendipity_syncThumbs($deleteThumbs);
$data['print_SYNC_DONE'] = sprintf(SYNC_DONE, $i);
flush();
$i = serendipity_generateThumbs(); $i = serendipity_generateThumbs();
$data['print_RESIZE_DONE'] = sprintf(RESIZE_DONE, $i); $data['print_RESIZE_DONE'] = sprintf(RESIZE_DONE, $i);
flush(); flush();

View File

@ -832,7 +832,7 @@ function serendipity_generateThumbs() {
echo "\n" . '<ul class="serendipityFileList">' . "\n"; echo "\n" . '<ul class="serendipityFileList">' . "\n";
$msg_printed = true; $msg_printed = true;
} }
echo '<li>' . $sThumb . ': ' . $returnsize[0] . 'x' . $returnsize[1] . "</li>\n"; echo '<li>' . $sThumb . ': ' . $returnsize['width'] . 'x' . $returnsize['height'] . "</li>\n";
if (!file_exists($newThumb)) { if (!file_exists($newThumb)) {
printf('<li><span class="msg_error"><span class="icon-attention"></span> ' . THUMBNAIL_FAILED_COPY . '</span></li>' . "\n", $sThumb); printf('<li><span class="msg_error"><span class="icon-attention"></span> ' . THUMBNAIL_FAILED_COPY . '</span></li>' . "\n", $sThumb);
} else { } else {
@ -1097,6 +1097,7 @@ function serendipity_syncThumbs($deleteThumbs = false) {
$files = serendipity_fetchImages(); $files = serendipity_fetchImages();
$fcount = count($files); $fcount = count($files);
for ($x = 0; $x < $fcount; $x++) { for ($x = 0; $x < $fcount; $x++) {
$update = array(); $update = array();
$f = serendipity_parseFileName($files[$x]); $f = serendipity_parseFileName($files[$x]);