diff --git a/Aaru.Localization/UI.Designer.cs b/Aaru.Localization/UI.Designer.cs index e39a9f5e8..6a0909877 100644 --- a/Aaru.Localization/UI.Designer.cs +++ b/Aaru.Localization/UI.Designer.cs @@ -6687,5 +6687,17 @@ namespace Aaru.Localization { return ResourceManager.GetString("Verify_only_data_help", resourceCulture); } } + + public static string Images_have_different_contents { + get { + return ResourceManager.GetString("Images_have_different_contents", resourceCulture); + } + } + + public static string Images_have_identical_contents { + get { + return ResourceManager.GetString("Images_have_identical_contents", resourceCulture); + } + } } } diff --git a/Aaru.Localization/UI.es.resx b/Aaru.Localization/UI.es.resx index 86bfd9767..a61197c78 100644 --- a/Aaru.Localization/UI.es.resx +++ b/Aaru.Localization/UI.es.resx @@ -3344,4 +3344,10 @@ Probadores: Verificar sólo pistas de datos. + + [red]Las imágenes tienen diferente contenido.[/] + + + [green]Las imágenes tienen idéntico contenido.[/] + \ No newline at end of file diff --git a/Aaru.Localization/UI.resx b/Aaru.Localization/UI.resx index 511bb832d..d85388d32 100644 --- a/Aaru.Localization/UI.resx +++ b/Aaru.Localization/UI.resx @@ -3419,4 +3419,10 @@ Do you want to continue? Verify only data tracks. + + [red]Images have different contents.[/] + + + [green]Images have identical contents.[/] + \ No newline at end of file diff --git a/Aaru/Commands/Image/Compare.cs b/Aaru/Commands/Image/Compare.cs index 646a65b11..d4533229f 100644 --- a/Aaru/Commands/Image/Compare.cs +++ b/Aaru/Commands/Image/Compare.cs @@ -420,6 +420,8 @@ sealed class CompareCommand : Command if(input1MediaImage is not null && input2MediaImage is null) imagesDiffer = true; + bool differentContents = false; + if(input1MediaImage is not null && input2MediaImage is not null) { AnsiConsole.Progress() @@ -462,13 +464,22 @@ sealed class CompareCommand : Command image2Sector); if(different) - imagesDiffer = true; + { + imagesDiffer = true; + differentContents = true; + AaruLogging.Debug(MODULE_NAME, "Sector {0} is different", sector); + } + else if(!sameSize) + { + imagesDiffer = true; + differentContents = true; - // sb.AppendFormat("Sector {0} is different", sector).AppendLine(); - else if(!sameSize) imagesDiffer = true; - /* sb. - AppendFormat("Sector {0} has different sizes ({1} bytes in image 1, {2} in image 2) but are otherwise identical", - sector, image1Sector.LongLength, image2Sector.LongLength).AppendLine();*/ + AaruLogging.Debug(MODULE_NAME, + "Sector {0} has different sizes ({1} bytes in image 1, {2} in image 2) but are otherwise identical", + sector, + image1Sector.LongLength, + image2Sector.LongLength); + } } catch(Exception ex) { @@ -513,9 +524,10 @@ sealed class CompareCommand : Command ArrayHelpers.CompareBytes(out bool different, out bool sameSize, data1, data2); - if(different) - imagesDiffer = true; - else if(!sameSize) imagesDiffer = true; + if(!different && sameSize) return; + + imagesDiffer = true; + differentContents = true; }); } @@ -523,6 +535,8 @@ sealed class CompareCommand : Command sb.AppendLine(imagesDiffer ? UI.Images_differ : UI.Images_do_not_differ); + sb.AppendLine(differentContents ? UI.Images_have_different_contents : UI.Images_have_identical_contents); + if(settings.Verbose) AnsiConsole.Write(table); else