diff --git a/src/sfs/wadcvt.dpr b/src/sfs/wadcvt.dpr
index 4885b327e10e3a45ba4e22ee0d72228b2a68319a..d8058379b63784914b93e0b581a934e50bc9a236 100644 (file)
--- a/src/sfs/wadcvt.dpr
+++ b/src/sfs/wadcvt.dpr
sfs,
sfsPlainFS,
sfsZipFS,
- paszlib;
+ paszlib,
+ ImagingTypes, Imaging, ImagingUtility;
procedure processed (count: Cardinal);
buflen: Integer;
f: Integer;
st: string[24];
+ img: string;
begin
result := fname;
if length(ExtractFileExt(fname)) <> 0 then exit;
end;
end;
// targa (stupid hack; this "signature" is not required by specs)
+ {
if buflen >= 18 then
begin
Move((buf+buflen-18)^, (PChar(@st[1]))^, 16);
exit;
end;
end;
+ }
+ // detect image format
+ img := DetermineMemoryFormat(buf, buflen);
+ if length(img) > 0 then
+ begin
+ result := result+'.'+img;
+ exit;
+ end;
+ // check if this is text file
+ if buflen > 16 then
+ begin
+ for f := 0 to buflen-1 do
+ begin
+ if buf[f] = #127 then exit;
+ if buf[f] < #32 then
+ begin
+ if (buf[f] <> #9) and (buf[f] <> #10) and (buf[f] <> #13) then exit;
+ end;
+ end;
+ result := result+'.txt';
+ end;
finally
FreeMem(buf);
end;
//fs.Free();
//fs := SFSFileOpen(dvfn+'::'+fl[f].fPath+fl[f].fName);
fs.position := 0;
+{$IFNDEF WINDOWS}
+ write(#13'[', f+1, '/', fl.Count, ']: ', fl[f].fPath, newname, ' ', fs.size, ' ... '#27'[K');
+{$ELSE}
write('[', f+1, '/', fl.Count, ']: ', fl[f].fPath, newname, ' ', fs.size, ' ... ');
+{$ENDIF}
nfo := ZipOne(fo, fl[f].fPath+newname, fs);
- writeln('DONE');
+ write('DONE');
+{$IFDEF WINDOWS}
+ writeln;
+{$ENDIF}
SetLength(files, length(files)+1);
files[high(files)] := nfo;
end;
+{$IFNDEF WINDOWS}
+ writeln(#13, fl.Count, ' files processed'#27'[K');
+{$ENDIF}
writeCentralDir(fo, files);
except
fo.Free();