Page 1 of 1

mobileExportImageToAlbum broken?

Posted: Fri May 24, 2013 9:53 am
by pkocsis
community 6.0.1

On android, trying to export an image to album/gallery by:

put the long ID of image "myImage" into tImageID
mobileExportImageToAlbum tImageID, "my_file"

...yet I get "export failed" every time....(and YES, there is a valid 'image "myImage"')

Does mobileExportImageToAlbum not work on android? How about iOS?

Testing on a sprint Nexus S (Android 4.1.1)

EDIT: It has been suggested in other threads to "export image" to a full path such as "/sdcard/Pictures/my_file.jpg". While indeed a file can be successfully written, this workaround is not so good because (on my Nexus S 4.1.1) a "rescan" of the media library is not performed, and the newly "exported" image is not visible when going to "gallery". One must power down then up in order to make the phone "scan" for new pictures. After a re-boot, the "exported" image can indeed be seen using android's "gallery"...As part of this "export image" workaround, I've been trying to find a way to force android to "re-scan", but have failed in all attempts. (Note that when tapping "gallery", the menu key has a "refresh" option....tapping that option does NOT force android to rescan the Pictures folder for changes)

Re: mobileExportImageToAlbum broken?

Posted: Sat Nov 09, 2013 4:18 pm
by Mag
Under iOS, mobileExportImageToAlbum works fine. Instead I think I have the same problem with this command under Android.

PS
I think that to use "export image" command in Android you need to know exactly where to export, and maybe you need an external to do this (e.g. mergAndroid). In fact under Android, specialFolderPath LC's function, gives you only "engine", "documents" and "cache" directories.

Anyway I tried to do in that way, but maybe I'm missing something because it don't work:

Code: Select all

put mergStoragePath("pictures") into myPath -- uses mergAndroid external
answer myPath -- and the path looks like OK (maybe): /mnt/sdcard/Pictures
export image myImage of card myCard to file (myPath &"/photo34443.jpg") as JPEG -- don't work

Re: mobileExportImageToAlbum broken?

Posted: Sat Dec 14, 2013 2:16 pm
by Mag
OK, mobileExportImageToAlbum don't work because a LiveCode bug.
The other way (using mergStoragePath - mergAndroid external) it seems does work.

Any other way to export an image/video on the Android's device camera roll?

Re: mobileExportImageToAlbum broken?

Posted: Fri Oct 24, 2014 2:26 am
by pkocsis
I know RR has been busy with 665 670 and 7 (and the 6.5 series before that), but as far as I can tell, mobileExportImageToAlbum has *NEVER* worked on android. Complaints and bug reports are nearly a year old.

Such a fundamental feature, and it just flat out does not work ("export failed"). I'm astonished its never been addressed....(sigh).....

Re: mobileExportImageToAlbum broken?

Posted: Fri Oct 24, 2014 4:09 am
by Simon
Hi pkocsis,
You probably don't want a workaround but... here.

Code: Select all

on mouseUp
   set the defaultFolder to "/mnt/sdcard/DCIM/"
   put image "myImage" into url("binfile:picTest.jpg")
   answer the result
end mouseUp
That will show up in the Gallery.
If loading via USB, remember to unplug it or the sd card won't show up.

Simon
Edit; For those devices that don't have an sd card you just search for DCIM in the root.

Re: mobileExportImageToAlbum broken?

Posted: Fri Oct 24, 2014 9:53 am
by Mag
pkocsis wrote:I know RR has been busy with 665 670 and 7 (and the 6.5 series before that), but as far as I can tell, mobileExportImageToAlbum has *NEVER* worked on android. Complaints and bug reports are nearly a year old.

Such a fundamental feature, and it just flat out does not work ("export failed"). I'm astonished its never been addressed....(sigh).....

I had to throw a project due to this bug, hours and hours trying to find a working workaround. Of course maybe I'm clumsy but I have not found anything really reliable to show pictures in all devices. This is the life of those who use LiveCode to make apps. :roll:

Re: mobileExportImageToAlbum broken?

Posted: Fri Oct 24, 2014 2:45 pm
by newtronsols
Simon wrote:Hi pkocsis,
You probably don't want a workaround but... here.

Code: Select all

on mouseUp
   set the defaultFolder to "/mnt/sdcard/DCIM/"
   put image "myImage" into url("binfile:picTest.jpg")
   answer the result
end mouseUp
That will show up in the Gallery.
If loading via USB, remember to unplug it or the sd card won't show up.

Simon
Edit; For those devices that don't have an sd card you just search for DCIM in the root.
i tried this with the example in the bug report: http://quality.runrev.com/show_bug.cgi?id=11417

But had the message "can't open file".

Re: mobileExportImageToAlbum broken?

Posted: Fri Oct 24, 2014 11:39 pm
by pkocsis
Simon wrote:Hi pkocsis,
You probably don't want a workaround but... here.

Code: Select all

on mouseUp
   set the defaultFolder to "/mnt/sdcard/DCIM/"
   put image "myImage" into url("binfile:picTest.jpg")
   answer the result
end mouseUp
That will show up in the Gallery.
If loading via USB, remember to unplug it or the sd card won't show up.

Simon
Edit; For those devices that don't have an sd card you just search for DCIM in the root.
Thanks Simon but it only shows up if the phone is rebooted since this workaround does not notify the OS to re-scan. Is there some way I can fake the OS into rescanning the gallery?