Ver código fonte

Convert.hx CompressIMG check for file renaming if compress failed. Will throw on converted file not found.

clementlandrin 11 meses atrás
pai
commit
cfe54b5539
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      hxd/fs/Convert.hx

+ 3 - 1
hxd/fs/Convert.hx

@@ -309,7 +309,9 @@ class CompressIMG extends Convert {
 			command("texconv", args);
 			sys.FileSystem.deleteFile(tmpFile);
 			tmpPath.ext = "tmp.DDS";
-			sys.FileSystem.rename(tmpPath.toString(), dstPath);
+			var p = tmpPath.toString();
+			if ( sys.FileSystem.exists(p) )
+				sys.FileSystem.rename(p, dstPath);
 			return;
 		}
 		var path = new haxe.io.Path(srcPath);