$wfile = $this->wdir . 'commerce/' . $fname;
if (file_exists($wfile)) {
- $s = CubeIT_Image::getimagesize($wfile);
- $html = '<img src="data/commerce/' . $fname . '" style="background:white;" data-width="' . $s[0] . '" data-height="' . $s[1] . '" />';
+ if (stristr($wfile, '.png') || stristr($wfile, '.jpg')) {
+ $s = CubeIT_Image::getimagesize($wfile);
+ $html = '<img src="data/commerce/' . $fname . '" style="background:white;" data-width="' . $s[0] . '" data-height="' . $s[1] . '" />';
+ } else {
+ $html = 'data/commerce/' . $fname;
+ }
$this->vdir->copy($wfile, 'data/commerce/' . $fname);
$fname = $html;
} else {