-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MediaPicker.Default.CapturePhotoAsync missing important option like SaveToAlbum, PhotoSize, CompressionQuality #11353
Comments
I will be putting out a proposal for this soon! However, this won't be implemented until .NET 8. In the meanwhile have a look at https://github.com/dimonovdd/Xamarin.MediaGallery which should have all this and supports .NET MAUI. As for the implementation of this, are you missing anything that you wish the Xamarin MediaPicker had? Or things that should work differently? Anything of which you think: if there was a newer version I wish this would be better? |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Thanks for the quick response, Gerald! The description of this package
does not look encouraging. It indicates that it does not support Maui in
particular. Should I just ignore that and forge ahead with it?
This Xamarin MediaPicker had the features I needed. About the only thing
that I can think of is access to the photo editor so that it would be
possible to easily rotate and crop a photo that was just taken (without
going to the gallery).
This plugin is designed for picking and saving photos and video files from
the native gallery of Android and iOS devices and capture photo.
*Unfortunately, at the time of the release of this plugin, MediaPlugin
<https://github.com/jamesmontemagno/MediaPlugin> by @jamesmontemagno
<https://github.com/jamesmontemagno> is no longer supported, and
Xamarin.Essentials <https://github.com/xamarin/Essentials> has not received
updates for about 2 months.* *This plugin has fixed bugs and added some
features that are missing in Xamarin.Essentials
<https://github.com/xamarin/Essentials>. I hope that in the future it will
be ported to MAUI <https://github.com/dotnet/maui> so that developers have
an easy way to add these features to their apps.*
…On Tue, Nov 15, 2022 at 2:54 AM msftbot[bot] ***@***.***> wrote:
We've moved this issue to the Backlog milestone. This means that it is not
going to be worked on for the coming release. We will reassess the backlog
following the current release and consider this item at that time. To learn
more about our issue management process and to have better expectation
regarding different types of issues you can read our Triage Process
<https://github.com/dotnet/maui/blob/main/docs/TriageProcess.md>.
—
Reply to this email directly, view it on GitHub
<#11353 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHE7K5CWJYRRQETL4ID2TDWINMTZANCNFSM6AAAAAASAIQT6U>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@cdavidyoung I think you're reading the description wrong. The author of MediaGallery is stating that other plugins don't seem to be maintained and lacking .NET MAUI support. This is the reason that he created MediaGallery. MediaGallery, as far as I know, has everything that is in our MediaPicker and more. |
Thanks for the advice, Gerald! Now that you pointed it out, the
description is ambiguous and it could very well be as you say. I'll give
it a try!
Charles
…On Wed, Nov 16, 2022 at 4:27 AM Gerald Versluis ***@***.***> wrote:
@cdavidyoung <https://github.com/cdavidyoung> I think you're reading the
description wrong. The author of MediaGallery is stating that *other*
plugins don't seem to be maintained and lacking .NET MAUI support. This is
the reason that he created MediaGallery.
MediaGallery, as far as I know, has everything that is in our MediaPicker
and more.
—
Reply to this email directly, view it on GitHub
<#11353 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHE7K77XMPCXX5A3QI24BTWITAKJANCNFSM6AAAAAASAIQT6U>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
After adding the NativeMedia.Platform.Init it gives me a MSBUILD : java.exe
error JAVA0000. I wonder if it has to do with net7.0 that I am using.
using Android.App;
using Android.Content.PM;
using Android.OS;
namespace jiffyLog;
[Activity(Theme = ***@***.***/Maui.SplashTheme", MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation
| ConfigChanges.UiMode | ConfigChanges.ScreenLayout |
ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
//...
base.OnCreate(savedInstanceState);
NativeMedia.Platform.Init(this, savedInstanceState);
//...
}
}
1>jiffyLog ->
C:\Users\charl\source\repos\GitHub\jiffyLog\bin\Debug\net7.0-android\ZipidyDo.dll
1>MSBUILD : java.exe error JAVA0000: Error in
C:\Users\charl\.nuget\packages\xamarin.google.guava.listenablefuture\1.0.0.9\buildTransitive\net6.0-android31.0\..\..\jar\guava-listenablefuture.jar:com/google/common/util/concurrent/ListenableFuture.class:
1>MSBUILD : java.exe error JAVA0000: Type
com.google.common.util.concurrent.ListenableFuture is defined multiple
times:
C:\Users\charl\.nuget\packages\xamarin.google.guava.listenablefuture\1.0.0.9\buildTransitive\net6.0-android31.0\..\..\jar\guava-listenablefuture.jar:com/google/common/util/concurrent/ListenableFuture.class,
obj\Debug\net7.0-android\lp\184\jl\libs\E0614835FEE16B6F.jar:com/google/common/util/concurrent/ListenableFuture.class
1>MSBUILD : java.exe error JAVA0000: Compilation failed
On Wed, Nov 16, 2022 at 5:09 AM Charles David Young <
***@***.***> wrote:
… Thanks for the advice, Gerald! Now that you pointed it out, the
description is ambiguous and it could very well be as you say. I'll give
it a try!
Charles
On Wed, Nov 16, 2022 at 4:27 AM Gerald Versluis ***@***.***>
wrote:
> @cdavidyoung <https://github.com/cdavidyoung> I think you're reading the
> description wrong. The author of MediaGallery is stating that *other*
> plugins don't seem to be maintained and lacking .NET MAUI support. This is
> the reason that he created MediaGallery.
>
> MediaGallery, as far as I know, has everything that is in our MediaPicker
> and more.
>
> —
> Reply to this email directly, view it on GitHub
> <#11353 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAHE7K77XMPCXX5A3QI24BTWITAKJANCNFSM6AAAAAASAIQT6U>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
I can't get past the Android Required Setup. I get the following error. One problem is that there is no AndroidResource now in Maui and I have tried the other types or Resource but can't get by this. Error APT2260 resource xml/file_paths (aka com.CatchAll:xml/file_paths) not found. This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file. jiffyLog C:\Users\charl\source\repos\GitHub\jiffyLog\Platforms\Android\AndroidManifest.xml 1 |
Any advice on getting past this error? The copy to album is literally the last feature I need to publish my Maui app on 4 platforms, although this feature is really only needed on Android and iPhone. I have considered delving into the Xamarin code to port this feature from there to Maui. Any advice on the feasibility of this? |
Well, with Gerald's encouragement I finally got https://github.com/dimonovdd/Xamarin.MediaGallery to work for my app. I started by cloning the repo and building the sample app, which works. It demonstrates that it is possible to copy files to the gallery. Knowing that, I followed the README.md file closely. After installing the Xamarin.MediaGallery nuget and doing the things required in README.md for Android (iOS does not need any special initialization because I was already taking photos in my app) you basically add at the beginning of the file where you want to use this: using NativeMedia; Then make sure this is only used for iOS and Android. Note that I am using standard Maui code for taking the photos. I am only using this to copy the photo to the gallery. I may look into MediaGallery to take the photo as well if it allows a compression option.
|
You are using old version of nuget Explicitly add latest version of
That should help. And please report here if that helps. if not I will need list of |
there's any workaround? |
What's the score with this? The comments above said this was going to be implemented in .Net 8 however we're running .Net 8 and it's still not possible to set these properties. Just yet another bug in Maui which there seems to be no urgency to fix. |
We are forced to migrate from Xamarin to Maui since there is no longer support for new Android and iOS versions, I would have expected at least equal functionality to Xamarin instead Maui is years of development far away! |
Description
I am re-engineering my Xamarin app for Maui. I know the latter is still under development so I would like to request these features. In the meanwhile if there is a workaround for the SaveToAlbum option I would appreciate a pointer. Thanks.
Public API Changes
MediaPicker.Default.CapturePhotoAsync(new StoreCameraMediaOptions()
{
DefaultCamera = Plugin.Media.Abstractions.CameraDevice.Rear,
SaveToAlbum = true,
PhotoSize = PhotoSize.Medium,
CompressionQuality = 92,
});
Intended Use-Case
The user can take a photo from within my app at which point I also record an audio snippet that corresponds with the moment the photo is taken. In addition to the app DB, it is important that the photo be stored in the user gallery so that they can easily access the photo later.
The text was updated successfully, but these errors were encountered: