@@ -87,22 +87,24 @@ def load_files(self, folder):
87
87
def load_thumbnail (self , file_path ):
88
88
try :
89
89
image = None
90
+ base_path = os .path .dirname (os .path .abspath (__file__ ))
91
+
90
92
if file_path .endswith (".vtf" ):
91
- image = Image .open (os .path .join ("icons" , "VTFEdit.png" ))
93
+ image = Image .open (os .path .join (base_path , "icons" , "VTFEdit.png" ))
92
94
elif file_path .endswith (".mdl" ):
93
- image = Image .open (os .path .join ("icons" , "hlmv.png" ))
95
+ image = Image .open (os .path .join (base_path , "icons" , "hlmv.png" ))
94
96
elif file_path .endswith (".tga" ):
95
97
image = Image .open (file_path )
96
98
elif file_path .endswith (".vmf" ):
97
- image = Image .open (os .path .join ("icons" , "hammer.png" ))
99
+ image = Image .open (os .path .join (base_path , "icons" , "hammer.png" ))
98
100
elif file_path .endswith (".vcd" ):
99
- image = Image .open (os .path .join ("icons" , "hlposer.png" ))
101
+ image = Image .open (os .path .join (base_path , "icons" , "hlposer.png" ))
100
102
elif file_path .endswith (".bsp" ):
101
- image = Image .open (os .path .join ("icons" , "source.png" ))
103
+ image = Image .open (os .path .join (base_path , "icons" , "source.png" ))
102
104
elif os .path .isdir (file_path ):
103
- image = Image .open (os .path .join ("icons" , "fileexplorer.png" ))
105
+ image = Image .open (os .path .join (base_path , "icons" , "fileexplorer.png" ))
104
106
elif file_path .endswith (".txt" ) or file_path .endswith (".res" ) or file_path .endswith (".vmt" ) or file_path .endswith (".qc" ) or file_path .endswith (".smd" ):
105
- image = Image .open (os .path .join ("icons" , "txt.png" ))
107
+ image = Image .open (os .path .join (base_path , "icons" , "txt.png" ))
106
108
107
109
if image :
108
110
image .thumbnail ((50 , 50 ))
0 commit comments