Set geometry before start writing image, as some floppy based images are geometry based.

This commit is contained in:
2018-01-04 01:03:54 +00:00
parent 8dcbae5fa0
commit 91098f7b0e

View File

@@ -266,6 +266,14 @@ namespace DiscImageChef.Commands
if(tracks == null)
{
DicConsole.WriteLine("Setting geometry to {0} cylinders, {1} heads and {2} sectors per track",
inputFormat.Info.Cylinders, inputFormat.Info.Heads,
inputFormat.Info.SectorsPerTrack);
if(!outputFormat.SetGeometry(inputFormat.Info.Cylinders, inputFormat.Info.Heads,
inputFormat.Info.SectorsPerTrack))
DicConsole.ErrorWriteLine("Error {0} setting geometry, image may be incorrect, continuing...",
outputFormat.ErrorMessage);
while(doneSectors < inputFormat.Info.Sectors)
{
byte[] sector;
@@ -553,17 +561,6 @@ namespace DiscImageChef.Commands
}
}
if(tracks == null)
{
DicConsole.WriteLine("Setting geometry to {0} cylinders, {1} heads and {2} sectors per track",
inputFormat.Info.Cylinders, inputFormat.Info.Heads,
inputFormat.Info.SectorsPerTrack);
if(!outputFormat.SetGeometry(inputFormat.Info.Cylinders, inputFormat.Info.Heads,
inputFormat.Info.SectorsPerTrack))
DicConsole.ErrorWriteLine("Error {0} setting geometry, image may be incorrect, continuing...",
outputFormat.ErrorMessage);
}
DicConsole.WriteLine("Closing output image.");
if(!outputFormat.Close())