From 91098f7b0ea820f9e815c8860956f2e351047b51 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 4 Jan 2018 01:03:54 +0000 Subject: [PATCH] Set geometry before start writing image, as some floppy based images are geometry based. --- DiscImageChef/Commands/ConvertImage.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/DiscImageChef/Commands/ConvertImage.cs b/DiscImageChef/Commands/ConvertImage.cs index a66f6ece1..57640352f 100644 --- a/DiscImageChef/Commands/ConvertImage.cs +++ b/DiscImageChef/Commands/ConvertImage.cs @@ -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())