Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] Use corrected tint and fade adjustments

r4khulcbbae6a8c411
diff --git a/mobile/apps/photos/assets/image-editor/image-editor-luminance.svg b/mobile/apps/photos/assets/image-editor/image-editor-luminance.svg
deleted file mode 100644
index 02ffd024bd..0000000000
--- a/mobile/apps/photos/assets/image-editor/image-editor-luminance.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M10.163 17H14.836M12.5 3V4M18.864 5.636L18.157 6.343M21.5 12H20.5M4.5 12H3.5M6.843 6.343L6.136 5.636M8.964 15.536C8.26487 14.8367 7.7888 13.9458 7.59598 12.9759C7.40316 12.006 7.50225 11.0008 7.88073 10.0872C8.25921 9.17366 8.90007 8.39284 9.72229 7.84349C10.5445 7.29414 11.5111 7.00093 12.5 7.00093C13.4889 7.00093 14.4555 7.29414 15.2777 7.84349C16.0999 8.39284 16.7408 9.17366 17.1193 10.0872C17.4977 11.0008 17.5968 12.006 17.404 12.9759C17.2112 13.9458 16.7351 14.8367 16.036 15.536L15.488 16.083C15.1745 16.3962 14.9259 16.7682 14.7564 17.1776C14.5868 17.587 14.4997 18.0259 14.5 18.469V19C14.5 19.5304 14.2893 20.0391 13.9142 20.4142C13.5391 20.7893 13.0304 21 12.5 21C11.9696 21 11.4609 20.7893 11.0858 20.4142C10.7107 20.0391 10.5 19.5304 10.5 19V18.469C10.5 17.574 10.144 16.715 9.512 16.083L8.964 15.536Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
-</svg>
diff --git a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart
index b2a227d5e4..5b18dbb84f 100644
--- a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart
+++ b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart
@@ -33,7 +33,6 @@ import "package:photos/ui/tools/editor/image_editor/image_editor_filter_bar.dart
import "package:photos/ui/tools/editor/image_editor/image_editor_main_bottom_bar.dart";
import "package:photos/ui/tools/editor/image_editor/image_editor_paint_bar.dart";
import "package:photos/ui/tools/editor/image_editor/image_editor_text_bar.dart";
-import "package:photos/ui/tools/editor/image_editor/image_editor_tune_adjustments.dart";
import "package:photos/ui/tools/editor/image_editor/image_editor_tune_bar.dart";
import "package:photos/ui/viewer/file/detail_page.dart";
import "package:photos/utils/dialog_util.dart";
@@ -242,6 +241,7 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
exposure: context.strings.imageEditorExposure,
hue: context.strings.imageEditorHue,
temperature: context.strings.imageEditorTemperature,
+ tint: context.strings.imageEditorTint,
fade: context.strings.imageEditorFade,
);
return PopScope(
@@ -588,10 +588,6 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
),
),
tuneEditor: TuneEditorConfigs(
- tuneAdjustmentOptions: imageEditorTuneAdjustments(
- tuneI18n,
- context.strings.imageEditorLuminance,
- ),
style: TuneEditorStyle(
background: colors.backgroundBase,
uiOverlayStyle: editorUiOverlayStyle,
diff --git a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_tune_adjustments.dart b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_tune_adjustments.dart
deleted file mode 100644
index 6f71347827..0000000000
--- a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_tune_adjustments.dart
+++ /dev/null
@@ -1,82 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:pro_image_editor/features/tune_editor/utils/tune_presets.dart';
-import 'package:pro_image_editor/pro_image_editor.dart';
-
-List<TuneAdjustmentItem> imageEditorTuneAdjustments(
- I18nTuneEditor i18n,
- String luminanceLabel,
-) {
- final presets = tunePresets(icons: const TuneEditorIcons(), i18n: i18n);
- // Keep Ente's luminance and fade behavior across the 13.x update.
- return [
- ...presets.take(6),
- TuneAdjustmentItem(
- id: 'luminance',
- icon: Icons.light_mode_outlined,
- label: luminanceLabel,
- min: -1,
- max: 1,
- divisions: 200,
- toMatrix: _luminanceMatrix,
- ),
- presets.last.copyWith(toMatrix: _fadeMatrix),
- ];
-}
-
-List<double> _luminanceMatrix(double value) {
- const red = 0.2126;
- const green = 0.7152;
- const blue = 0.0722;
- final original = 1 - value;
- return [
- red * value + original,
- green * value,
- blue * value,
- 0,
- 0,
- red * value,
- green * value + original,
- blue * value,
- 0,
- 0,
- red * value,
- green * value,
- blue * value + original,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- ];
-}
-
-List<double> _fadeMatrix(double value) {
- const red = 0.3086;
- const green = 0.6094;
- const blue = 0.082;
- final original = 1 - value;
- return [
- original + red * value,
- green * value,
- blue * value,
- 0,
- 0,
- red * value,
- original + green * value,
- blue * value,
- 0,
- 0,
- red * value,
- green * value,
- original + blue * value,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- ];
-}
diff --git a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_tune_bar.dart b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_tune_bar.dart
index 698844200c..897ffd56ae 100644
--- a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_tune_bar.dart
+++ b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_tune_bar.dart
@@ -197,7 +197,7 @@ class TuneItem extends StatelessWidget {
String? _svgPathForID(String id) {
return switch (id) {
- "luminance" || "fade" => "assets/image-editor/image-editor-$id.svg",
+ "fade" => "assets/image-editor/image-editor-fade.svg",
_ => null,
};
}
diff --git a/mobile/packages/strings/lib/l10n/arb/strings_en.arb b/mobile/packages/strings/lib/l10n/arb/strings_en.arb
index 547065253d..3b6d7754a7 100644
--- a/mobile/packages/strings/lib/l10n/arb/strings_en.arb
+++ b/mobile/packages/strings/lib/l10n/arb/strings_en.arb
@@ -1957,9 +1957,9 @@
"imageEditorExposure": "Exposure",
"imageEditorFade": "Fade",
"imageEditorHue": "Hue",
- "imageEditorLuminance": "Luminance",
"imageEditorSaturation": "Saturation",
"imageEditorTemperature": "Temperature",
+ "imageEditorTint": "Tint",
"imageNotAnalyzed": "Image not analyzed",
"immediate": "Immediate",
"immediately": "Immediately",