From 74fc04163437e1f301dea563a0264e2277893f74 Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 5 Feb 2012 01:09:53 +0000 Subject: feature 2562 added: pre-cache thumbnail at upload time git-svn-id: http://piwigo.org/svn/trunk@13030 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions_upload.inc.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'admin') diff --git a/admin/include/functions_upload.inc.php b/admin/include/functions_upload.inc.php index bfe972d25..648b8ddc6 100644 --- a/admin/include/functions_upload.inc.php +++ b/admin/include/functions_upload.inc.php @@ -334,6 +334,24 @@ SELECT invalidate_user_cache(); + // cache thumbnail + $query = ' +SELECT + id, + path + FROM '.IMAGES_TABLE.' + WHERE id = '.$image_id.' +;'; + $image_infos = pwg_db_fetch_assoc(pwg_query($query)); + + set_make_full_url(); + // in case we are on uploadify.php, we have to replace the false path + $thumb_url = preg_replace('#admin/include/i#', 'i', DerivativeImage::thumb_url($image_infos)); + unset_make_full_url(); + + fetchRemote($thumb_url, $dest); + + return $image_id; } -- cgit v1.2.3