$cdir = $this->wdir . '/commerce/';
$file = $cdir . $this->book->parametres->basketReferences;
- $this->config->basketReferences = wsUtil::excelToArrayKeyVars($file);
+ $this->config->basketReferences = wsUtil::excelToArrayKeyVars($file, 'Excel2007', true);
$odir = $cdir . '/opt/';
if (!file_exists($odir)) {
if (!$ean) {
continue;
}
+ if (!isset($this->config->basketReferences[$ean])) {
+ continue;
+ }
$f = $file->getPathname();
if ($ext === 'mp4') {
+ $n = $ean . '-360.mp4';
$this->config->basketReferences[$ean]['360'] = true;
- $opt = $odir . '/' . $ean . '-360.mp4';
+ $opt = $odir . '/' . $n;
if (!file_exists($opt) || !filesize($opt) || filemtime($opt) < filemtime($f)) {
// Optimize original video
`ffmpeg -i $f -filter:v scale=360:-2 -vcodec libx264 -an $opt`;
} else if (in_array('angle', $e)) {
$type = 'angle';
}
+ $n = $ean . '-' . $type . '.jpg';
$this->config->basketReferences[$ean][$type] = true;
- $opt = $odir . '/' . $ean . '-' . $type . '.jpg';
+ $opt = $odir . '/' . $n;
if (!file_exists($opt) || !filesize($opt) || filemtime($opt) < filemtime($f)) {
// Optimize original image
$convert = new CubeIT_Image_Resizer_ImageMagick();
$convert->loadImage($f);
- $convert->resize(1080, null, 'ratio', false, 'C', 'M', 'ffffff');
- $convert->output('jpg', $f, 75);
+ $convert->resize(1080, null, 'ratio', false, 'C', 'M', 'white');
+ $convert->output('jpg', $opt, 75);
}
}
-
-
+ $this->vdir->copy($opt, 'data/commerce/' . $n);
}
}