mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 19:59:56 +03:00
feature 2562 added: pre-cache thumbnail at upload time
git-svn-id: http://piwigo.org/svn/trunk@13030 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
5e9026e9f5
commit
74fc041634
1 changed files with 18 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue