Changeset 13030


Ignore:
Timestamp:
Feb 5, 2012, 2:09:53 AM (8 years ago)
Author:
plg
Message:

feature 2562 added: pre-cache thumbnail at upload time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_upload.inc.php

    r12917 r13030  
    335335  invalidate_user_cache();
    336336
     337  // cache thumbnail
     338  $query = '
     339SELECT
     340    id,
     341    path
     342  FROM '.IMAGES_TABLE.'
     343  WHERE id = '.$image_id.'
     344;';
     345  $image_infos = pwg_db_fetch_assoc(pwg_query($query));
     346
     347  set_make_full_url();
     348  // in case we are on uploadify.php, we have to replace the false path
     349  $thumb_url = preg_replace('#admin/include/i#', 'i', DerivativeImage::thumb_url($image_infos));
     350  unset_make_full_url();
     351 
     352  fetchRemote($thumb_url, $dest);
     353 
     354
    337355  return $image_id;
    338356}
Note: See TracChangeset for help on using the changeset viewer.