Mediaplugin: PickPhothoAsync always returns file with jpg extension.

Created on 7 Sep 2016  路  10Comments  路  Source: jamesmontemagno/MediaPlugin

Bug

Version Number of Plugin: 2.3.0
Device Tested On: Bq Edison 3G
Simulator Tested On:

Expected Behavior

Pick a png file and return a file with png extension

Actual Behavior

Always returns the file with jpg extension

Steps to reproduce the Behavior

Use PickPhotoAsync, select PNG file and display file.path
var file = await CrossMedia.Current.PickPhotoAsync ();
System.Diagnostics.Debug.WriteLine(file.path);

bug feature

All 10 comments

The image looks alright though?

I think it is hardcoded to .mp4 and .jpg though. Should be easy to work around and check to see if the file name is png get png or whatever it is. Will put in backlog.

The image looks alright inside the app but If I use it in PDF with a bitmap object, for example, the image doesn't print in PDF.
I thought validate the image format and only support JPG and BMP after PickPhotoAsync.
Thanks!

@jamesmontemagno is this bug fixed yet? Where can I get correct file extension

If it is still open then it hasn't been fixed.

I re-compress everything as a .jpg so it makes sense. It isn't a file picker, this is supposed to be used to be used for photo picking.

I will investigate, but it is pretty low priority.

@jamesmontemagno Is the re-compression done by default? becaues I faced error while sending the image to a REST Api service because I am sending a png file with jpg extension.

Is using image as byte array and sending to service with jpg extension a solution?

Check out: 2.6.0.16-beta

I now use the file name + extension instead of a name based on time.

@jamesmontemagno Thanks for your support :)

Please test out with your use case and report back.

@jamesmontemagno Checked my use case in 3 devices and emulator, its working fine now. Thanks for your time and support!

Hi @jamesmontemagno

I currently using ver 2.6.2. The file always return .jpg extension when I tried to attach .png file. Is there any method to get the file extension only using this media plugin?

Expected Behavior

Pick a png file and return a file with png extension

Actual Behavior

Always returns the file with jpg extension

Steps to reproduce the Behavior

Use PickPhotoAsync, select PNG file and display file.path
var file = await CrossMedia.Current.PickPhotoAsync ();
System.Diagnostics.Debug.WriteLine(file.path);

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DNF-SaS picture DNF-SaS  路  3Comments

manonaga2188 picture manonaga2188  路  5Comments

dmitrevski picture dmitrevski  路  7Comments

Furqanali30 picture Furqanali30  路  7Comments

mdcso picture mdcso  路  4Comments