getPicture from Library returns filename without extension on Android ( S3 )

  • 3
  • Problem
  • Updated 7 years ago
  • Not a Problem
Hi,

Im writing a file upload to a remote server like described in the documentation.
1) per capturePhoto and 2) per Select from the phone

But when i select a photo from local storage it returns a filename without extension:

content://media/external/images/media/1170
where "1170" seems to be the filename

Does anybody else ran into that issue?

Beside that, doesnt resize and quality working when selecting from the photo library? Image is 2,7MB big ://

Im using the code below for getting the picture:
navigator.camera.getPicture(onPhotoURISuccess, onFail, {
quality: 50,
destinationType: destinationType.FILE_URI,
sourceType: pictureSource.PHOTOLIBRARY,
correctOrientation: true,
encodingType: 0,
targetWidth: 800
});

Thanks for your help!
Photo of Felix Leon

Felix Leon

  • 10 Posts
  • 0 Reply Likes

Posted 7 years ago

  • 3
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Hello Felix

This community are mainly to discuss about Build issues and problems. Just in case if you haven't receive anymore answer over here, try forward a framework or programming related questions at our PhoneGap Framework forum. You could also subscribed to the PhoneGap paid support for greater support experience.

PhoneGap Community Forum: https://groups.google.com/forum/?from...
PhoneGap Paid Support: http://phonegap.com/support

Hope you'll find the answer soon.

Thanks
Photo of Felix Leon

Felix Leon

  • 10 Posts
  • 0 Reply Likes
Hi Amir,
good to know ;-) thought that phonegap and phonegap build is divided in two forums...

getPicture from Library hangs now completley ( sometimes ). and i didnt changed anything.. does this belog to phonegap build? or should i post that also in the phonegap framework forum?

Thanks!
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Hi Felix.

Not sure. But if you can share your Build appid, I could try to check that as soon as possible. The ID can be found at the URL bar:
https://build.phonegap.com/apps/####

Thanks
-Amir
Photo of Mario

Mario, Champion

  • 120 Posts
  • 17 Reply Likes
Hi Felix

I ran into this issue, too. :-)

On Android, you can not use the image if the path starts with 'content://'.
Use window.resolveLocalFileSystemURI to get the path to the file. Otherwise you will get an error.

Mario
Photo of Felix Leon

Felix Leon

  • 10 Posts
  • 0 Reply Likes
Hi Mario,
nice to here, i will give it a try.

But. the confusing thing is.. i tried it again today. withouth changing anything ( really ;-) )..
and it worked..

i will have a look on it next week, gotta have much more stuff to do ;-)

thanks for that hint!
Photo of Mario

Mario, Champion

  • 120 Posts
  • 17 Reply Likes
Interesting. In the end, we just want things to work. Often, we don't know why they work, but that's not always important. :-)
Photo of Felix Leon

Felix Leon

  • 10 Posts
  • 0 Reply Likes
In that case it is ;-) trying to find out why it sometimes works and sometimes not. trying your hint next week. feedback will come ;-)

ps: felixstecker in skype ;-)
Photo of Sreekanth Reddy

Sreekanth Reddy

  • 1 Post
  • 0 Reply Likes
Even i too Go the same issue taking picture from android gallery, Phonegap returning selected image as "content://media/external/images/media/1396". What does this mean...

1) How can i know the file selected from gallery is image/Video type
2) How can i get content:// to image path
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Hi Sreekanth,

Your post likely related to PhoneGap Framework or programming, rather then Build service. Kindly please re-post and continue to discussion at our PhoneGap Community Forum or at Stackoverflow.

*To get the most out of framework support, consider our PhoneGap Paid Support option: http://phonegap.com/support/

Thanks
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Topic closed due to inactive. If you have anymore issue, please raise new topic.

Thanks

This conversation is no longer open for comments or replies.