tanguy2m / AddFromServer

Piwigo plugin enabling photos association from local server
0 stars 0 forks source link

Supprimer la dépendance à getFullMissingDerivatives #63

Open tanguy2m opened 8 years ago

tanguy2m commented 8 years ago

Dans ws.inc.php, remplacer:

$derivatives = $service -> invoke("pwg.getFullMissingDerivatives", array(
  'types' => $types,
  'custom_width' => 9999,
  'custom_height' => $conf['GThumb']['height'],
  'ids' => $image_id
));

Par:

global $conf;
$conf['question_mark_in_urls'] = $conf['php_extension_in_urls'] = true;
$conf['derivative_url_style'] = 2; //script

$result = pwg_query('SELECT id, path, representative_ext, width, height, rotation
  FROM '.IMAGES_TABLE.'
  WHERE id='.$image_id);
$src_image = new SrcImage(pwg_db_fetch_assoc($result));
if ($src_image->is_mimetype())
  continue;
$derivative = new DerivativeImage(ImageStdParams::get_custom(9999, $conf['GThumb']['height']), $src_image);
return array('urls' => array($derivative->get_url().'&b='.time()));

et récupération des autres urls via le ws standard