/
Image.php
40 lines (27 loc) · 1.05 KB
/
Image.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
class TCVM_Product_Image extends WeFlex_Image
{
function __construct(){
$upload_url = TCVM::GetInstance()->config->product->image->upload_url;
$resizes = array();
if( TCVM::GetInstance()->config->product->image->resize ){
foreach( TCVM::GetInstance()->config->product->image->resize as $resize ){
$resize_temp = explode( '|' , $resize );
$resizes []= $resize_temp;
}
}
parent::__construct( $upload_url , $resizes );
}
public function formal( $index , $tempUrl ){
$imageFileName = $this->_getImageFileName( $tempUrl );
$tempImagePath = WeFlex_Application::GetInstance()->getPublicPath() . $tempUrl;
$regularDir = $this->_getRegularPath() . '/' . $index . '/' ;
$regularImagePath = $regularDir . $imageFileName;
$regularImageUrl = $this->_getRegularUrl() . '/' . $index . '/' . $imageFileName;
$this->_mkDir($regularDir);
$this->_copy ($tempImagePath , $regularImagePath );
$this->_generStandard($regularImagePath);
return $regularImageUrl;
}
}
?>