File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -155,18 +155,18 @@ def autoImport(self):
155155 position = element ["uv" ]
156156
157157 if canOpenImage (file ):
158- isSized = isImage16x16 (file )
158+ textureToReplace = Image .open (file )
159+ isSized = isImageSize (textureToReplace , element ["tileSize" ], element ["tileSize" ])
159160 if not (not isSized and not allowResize ):
160161 # Show new texture in preview frame
161- portviewImage = Image .open (file )
162- portviewRes = portviewImage .resize ((256 , 256 ), Image .Resampling .NEAREST )
162+ portviewRes = textureToReplace .resize ((256 , 256 ), Image .Resampling .NEAREST )
163163 root .previewFrame .portview .configure (dark_image = portviewRes )
164164
165165 # Replace texture
166166 print ("Opening new texture and replacing..." )
167- textureToReplace = Image . open ( file )
167+
168168 if not isSized :
169- textureToReplace = textureToReplace .resize ((16 , 16 ), Image .Resampling .LANCZOS )
169+ textureToReplace = textureToReplace .resize ((element [ "tileSize" ], element [ "tileSize" ] ), Image .Resampling .LANCZOS )
170170 atlas .addElement (position , textureToReplace )
171171
172172 if not os .path .exists (f"{ outputDir } /{ textureDestDir } " ):
You can’t perform that action at this time.
0 commit comments