xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

UWP camera save option is disabled untill you edit capture picture. #15861

Closed Pradeepgodaraitron closed 4 months ago

Pradeepgodaraitron commented 4 months ago

OS : Windows 10 Enterprise camera is not possible to save picture with Xamarin Essential Media Picker after taking picture without edit.

Steps to Reproduce Open the sample app Press take Photo button Try to capture a photo after photo taken new pop-up come click in save option in dropdown save as copy is enabled but save button is disabled. need to crop or edit photo to save button enabled.

Expected Behavior

Save button should be enabled after taking picture in UWP.

Actual Behavior:

Save button is disabled you cant save without edit photo.

Basic Information

Environment

Microsoft Visual Studio Professional 2022 Version 17.4.2 VisualStudio.17.Release/17.4.2+33122.133 Microsoft .NET Framework Version 4.8.09037

Installed Version: Professional

Visual C++ 2022 00476-80000-00000-AA783 Microsoft Visual C++ 2022

ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools

ASA Service Provider 1.0

ASP.NET and Web Tools 17.4.326.54890 ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.4.326.54890 Azure App Service Tools v3.0.0

Azure Data Lake Tools for Visual Studio 2.6.5000.0 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 17.4.326.54890 Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.6.5000.0 Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 4.4.0-6.22565.8+53091686b435746d62a5df56abfab0e71203d83a C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.4.1 (main@2ee106a) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft Azure Hive Query Language Service 2.6.5000.0 Language service for Hive query

Microsoft Azure Stream Analytics Language Service 2.6.5000.0 Language service for Azure Stream Analytics

Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio 17.4.19 (8c0a575) Support for debugging Mono processes with Visual Studio.

Node.js Tools 1.5.40817.1 Commit Hash:66443775f9f3b1d8f8fee47af5002828b346688d Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 6.4.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core) 17.0.0.2246202+61cc048d36a3fc9246d2f04625988b19a18ab8f0 Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.0.62207.28050 Microsoft SQL Server Data Tools

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript Tools 17.0.10921.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.4.0-6.22565.8+53091686b435746d62a5df56abfab0e71203d83a Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.4.0-beta.22512.4+525d5109e389341bb90b144c24e2ad1ceec91e7b Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

VSPackage Extension 1.0 VSPackage Visual Studio Extension Detailed Info

Xamarin 17.4.0.301 (d17-4@96af3ae) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 17.4.0.138 (remotes/origin/d17-4@d36bba3cc9) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 17.4.2 (c457c97) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 13.1.0.1 (d17-4/13ba222) Xamarin.Android Reference Assemblies and MSBuild support. Mono: a96bde9 Java.Interop: xamarin/java.interop/d17-4@fcc33ce2 SQLite: xamarin/sqlite/3.39.3@23e1ae7 Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a

Xamarin.iOS and Xamarin.Mac SDK 16.0.0.92 (3dd3dc52c) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

var mediaFile = await Media.Instance.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions { DefaultCamera = Plugin.Media.Abstractions.CameraDevice.Rear, PhotoSize = Plugin.Media.Abstractions.PhotoSize.Large, SaveToAlbum = false, AllowCropping = false, Directory = "Photos", Name = photoName });

Screenshots

image

Workaround

For saving Picture needs to edit photo then save button is enabled.

jfversluis commented 4 months ago

I think you might be confusing some things here. You mention Xamarin.Essentials, but the code you pasted seems to be from another plugin. In either case, this is not something that originates in Xamarin.Forms.

Additionally, I think the functionality is correct. Looking at your screenshot, the file is already saved under the name CCapture (3).jpg. That is why Windows disables the save option, it's already saved. And then the save option will only enable when a change is made because that change has not been saved yet.

I don't think there is an actual issue here and if there is, this is not the right place to report it.