@@ -17,7 +17,7 @@ public function getThumbPath($image_name = null)
1717
1818 public function getCurrentPath ($ file_name = null , $ is_thumb = null )
1919 {
20- $ path = $ this ->composeSegments ('dir ' , $ is_thumb) . $ file_name ;
20+ $ path = $ this ->composeSegments ('dir ' , $ is_thumb, $ file_name) ;
2121
2222 if ($ this ->isRunningOnWindows ()) {
2323 $ path = str_replace ('/ ' , '\\' , $ path );
@@ -33,17 +33,26 @@ public function getThumbUrl($image_name = null)
3333
3434 public function getFileUrl ($ image_name = null , $ is_thumb = null )
3535 {
36- $ url = $ this ->composeSegments ('url ' , $ is_thumb) . $ image_name ;
36+ $ url = $ this ->composeSegments ('url ' , $ is_thumb, $ image_name) ;
3737
38- return str_replace ( '\\' , ' / ' , $ url) ;
38+ return $ url ;
3939 }
4040
41- private function composeSegments ($ type , $ is_thumb )
41+ private function composeSegments ($ type , $ is_thumb, $ file_name )
4242 {
43- return $ this ->getPathPrefix ($ type )
43+ $ full_path = $ this ->getPathPrefix ($ type )
4444 . $ this ->getFormatedWorkingDir ()
4545 . '/ '
46- . $ this ->appendThumbFolderPath ($ is_thumb );
46+ . $ this ->appendThumbFolderPath ($ is_thumb )
47+ . $ file_name ;
48+
49+ $ full_path = str_replace ('\\' , '/ ' , $ full_path );
50+
51+ if (ends_with ($ full_path , '/ ' )) {
52+ $ full_path = substr ($ full_path , 0 , -1 );
53+ }
54+
55+ return $ full_path ;
4756 }
4857
4958 private function getFormatedWorkingDir ()
0 commit comments