mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 19:59:56 +03:00
fixes #979 derivative cache generation works even for file with representative picture
Cache medium size, instead of thumbnail.
This commit is contained in:
parent
a4187cabf0
commit
9f6e3e9080
1 changed files with 7 additions and 4 deletions
|
@ -391,23 +391,26 @@ SELECT
|
|||
|
||||
invalidate_user_cache();
|
||||
|
||||
// cache thumbnail
|
||||
// cache a derivative
|
||||
$query = '
|
||||
SELECT
|
||||
id,
|
||||
path
|
||||
path,
|
||||
representative_ext
|
||||
FROM '.IMAGES_TABLE.'
|
||||
WHERE id = '.$image_id.'
|
||||
;';
|
||||
$image_infos = pwg_db_fetch_assoc(pwg_query($query));
|
||||
$src_image = new SrcImage($image_infos);
|
||||
|
||||
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));
|
||||
$derivative_url = preg_replace('#admin/include/i#', 'i', DerivativeImage::url(IMG_MEDIUM, $src_image));
|
||||
unset_make_full_url();
|
||||
|
||||
fetchRemote($thumb_url, $dest);
|
||||
$logger->info(__FUNCTION__.' : force cache generation, derivative_url = '.$derivative_url);
|
||||
|
||||
fetchRemote($derivative_url, $dest);
|
||||
|
||||
return $image_id;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue