@@ -94,8 +94,11 @@ public function createDir($folderName, $permission){
9494 }
9595
9696
97- public function uploadFiles ($ yourFileName , $ yourDestination , $ minImgWidth =400 , $ waterMarkImgSrc ="" , $ xPosition ="" , $ yPosition ="" , $ reName ="" , $ permission =0655 , $ quality =100 , $ newWidth ="" ){
97+ public function uploadFiles ($ yourFileName , $ yourDestination , $ createThumb = false , $ minImgWidth =400 , $ waterMarkImgSrc ="" , $ xPosition ="" , $ yPosition ="" , $ reName ="" , $ permission =0655 , $ quality =100 , $ newWidth= "" , $ thumbWidth ="" ){
9898 if (!empty ($ _FILES [$ yourFileName ])){
99+ if ($ createThumb !="" and $ createThumb ===true ){
100+ $ srcThumbPath = self ::createDir ($ yourDestination .'/thumb ' , $ permission ).'/ ' ;
101+ }
99102 foreach ($ _FILES [$ yourFileName ]['name ' ] as $ val )
100103 {
101104 $ infoExt = getimagesize ($ _FILES [$ yourFileName ]['tmp_name ' ][$ this ->n ]);
@@ -112,9 +115,12 @@ public function uploadFiles($yourFileName, $yourDestination, $minImgWidth=400, $
112115 }else {
113116 $ fileName = $ files [0 ].$ File_Ext ;
114117 }
115- $ path = trim ($ srcPath .$ fileName );
116- if (self ::compressImage ($ _FILES [$ yourFileName ]['tmp_name ' ][$ this ->n ], $ path , $ minImgWidth , $ waterMarkImgSrc , $ xPosition , $ yPosition , $ quality , $ newWidth ))
117- {
118+ $ path = trim ($ srcPath .$ fileName );
119+ $ thumbPath = trim ($ srcThumbPath .$ fileName );
120+ if (self ::compressImage ($ _FILES [$ yourFileName ]['tmp_name ' ][$ this ->n ], $ path , $ minImgWidth , $ waterMarkImgSrc , $ xPosition , $ yPosition , $ quality , $ newWidth )){
121+
122+ self ::compressImage ($ _FILES [$ yourFileName ]['tmp_name ' ][$ this ->n ], $ thumbPath , $ minImgWidth , $ waterMarkImgSrc , $ xPosition , $ yPosition , $ quality , $ thumbWidth );
123+
118124 $ this ->prepareNames [] = $ fileName ; //need to be fixed.
119125 $ this ->Sflag = 1 ; // success
120126 }else {
0 commit comments