Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

Keep "Remove background" off the default image donut

SeoJCalive6226879e75de
diff --git a/src/Filee.Core/Presets/BuiltInData.cs b/src/Filee.Core/Presets/BuiltInData.cs
index b40fe897..65fab5c3 100644
--- a/src/Filee.Core/Presets/BuiltInData.cs
+++ b/src/Filee.Core/Presets/BuiltInData.cs
@@ -172,7 +172,7 @@ public static class BuiltInData
{
Id = "images", NameKey = "profile.images",
Extensions = ExtensionsOf(FormatCategory.Image),
- PresetIds = ["to-png", "to-jpg", "to-webp", "to-pdf", "to-tiff", "to-bmp", "to-ico", "half-size", "remove-background"],
+ PresetIds = ["to-png", "to-jpg", "to-webp", "to-pdf", "to-tiff", "to-bmp", "to-ico", "half-size"],
},
new()
{
diff --git a/src/Filee.Core/Settings/UserDataStore.cs b/src/Filee.Core/Settings/UserDataStore.cs
index 27c55786..ae92ef14 100644
--- a/src/Filee.Core/Settings/UserDataStore.cs
+++ b/src/Filee.Core/Settings/UserDataStore.cs
@@ -353,11 +353,11 @@ internal static class SettingsMigrations
changed |= Offer(presets, profiles, "pdf", "pdf-long-image", "to-jpg");
}
- // v10: "Remove background" (signatures, stamps, logos → transparent PNG), on the image donut after "half size".
+ // v10: "Remove background" (signatures, stamps, logos → transparent PNG), on no donut like HEIC: users add it
+ // in Settings → Toolbar.
if (from < 10 && presets.All(p => p.Id != "remove-background"))
{
presets.Add(BuiltInData.CreatePresets().Single(p => p.Id == "remove-background"));
- Offer(presets, profiles, "images", "remove-background", "half-size");
changed = true;
}
return changed;
diff --git a/tests/Filee.App.Tests/RenderTests.cs b/tests/Filee.App.Tests/RenderTests.cs
index d053ccb1..da2c5167 100644
--- a/tests/Filee.App.Tests/RenderTests.cs
+++ b/tests/Filee.App.Tests/RenderTests.cs
@@ -355,7 +355,7 @@ public class RenderTests
window.DonutControl.SetExternalHighlight(1);
Pump();
- Assert.Equal(9, vm.Items.Count); // the image donut includes "Remove background"
+ Assert.Equal(8, vm.Items.Count);
Assert.Equal("JPG 3개", vm.CenterTitle);
Save(window, "donut-images-ko.png");
window.Close();
diff --git a/tests/Filee.Core.Tests/UserDataStoreTests.cs b/tests/Filee.Core.Tests/UserDataStoreTests.cs
index 2408aa77..cf18bdab 100644
--- a/tests/Filee.Core.Tests/UserDataStoreTests.cs
+++ b/tests/Filee.Core.Tests/UserDataStoreTests.cs
@@ -194,21 +194,19 @@ public class UserDataStoreTests
}
[Fact]
- public void Version_9_libraries_get_remove_background_after_half_size()
+ public void Version_9_libraries_get_the_remove_background_preset_on_no_donut()
{
- // As written by 1.10.x: no "Remove background" preset, and the image donut without it.
+ // As written by 1.10.x: no "Remove background" preset.
var presets = BuiltInData.CreatePresets();
presets.RemoveAll(p => p.Id == "remove-background");
var profiles = BuiltInData.CreateProfiles();
- var images = profiles.Single(p => p.Id == "images");
- images.PresetIds.Remove("remove-background");
Assert.True(SettingsMigrations.ApplyToLibrary(9, presets, profiles));
var preset = presets.Single(p => p.Id == "remove-background");
Assert.True(preset.Image.RemoveBackground);
Assert.Equal("png", preset.TargetFormat);
- Assert.Equal(images.PresetIds.IndexOf("half-size") + 1, images.PresetIds.IndexOf("remove-background"));
+ Assert.DoesNotContain(profiles, p => p.PresetIds.Contains("remove-background"));
Assert.False(SettingsMigrations.ApplyToLibrary(9, presets, profiles)); // once only
}