Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Gideros Labs - Page 3 — Gideros Forum

Gideros Labs

13567

Comments

  • Commands to have a texture could then be used to save the texture to storage if needed. If you could selecta particular frame in video then you could also save frames to disk that the user selects (so you could video a face then the user picks the best image for the games player 'face').
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • And I let the fantasy flow :D

    getPicture lets select picture from the gallery
    and I don't think there is a way on Android or IOS to select the directory, all they can do is select a picture from a gallery (maybe they can select multiple pictures, will need to check)
    and postPicture adds picture to a gallery

    on PC getPicture, opens Open File Dialog and postPicture open Save File dialog.

    And I would not want to mix the plugin with internal textures, there will be other purpose classes for that, this one would only manage media files.

    As there is also currently no way to save texture to file, but collaborating with @atilim maybe it will be possible.

    Making video from bunch of pictures? Really? you would need that? Besides the fact that it might not be possible without heavy video libraries on mobile, I don't even think that many game devs would use it.

    From my perspective, I always try to imagine use cases:
    There could be a video which developer could want to play as cutscene.
    Then developer could want to take a screenshot, crop and resize it to their needs and allow user to save it to gallery (or later with newer Facebook SDK post to facebook).

    That all is possible now (well after more testing :) )and I'd say useful :)

    With get/set pixels you can start doing all kind of stuff, from filters to drawing mustaches upon someones photo. So maybe you could think in this way, what other modifications would you need for picture.
    For example, rotation and transformation, predefined filters, putting one picture upon the other, etc. All possible now, but maybe would be more efficient to do that on the C side, rather than Lua.

  • "Making video from bunch of pictures? Really? you would need that? "
    -completely agree that almost nobody needs it, i asked as perhaps it would have been easy to add. at some point i actually will need it in my animator app fragmenter to export animation not only to a sequence of images but to a video as well.
    on the other hand to export an image we should be able somehow to export not a screenshot but a screenshot of specific sprites (a rendertotexture item e.g.), as with this current media plugin whenever i want to export an image from the app i need to hide the overlay menu, export screenshot, show menu, which is a dull solution).
    so i hope that:
    "As there is also currently no way to save texture to file, but collaborating with @atilim maybe it will be possible."
    will be added to textures as an additional function.
    thanks
  • Wow. This is long-waited feature. Maybe option for saving-sharing screenshot will be added too?
    +1 for capturing/saving a screenshot if it's possible.

    Adding my bit of wishlist on top of that would be the ability to also capture a part of the screen by specifying a rectangle for the part you want (like Corona's captureBounds facility).
  • @ar2rsawseen I tried the media plug-in on our 'baseline' device (HTC Legend, which is Android 8). However, on either media:getPicture() or media:takePicture(), the gideros player app crashes with these errors:
    01-20 10:18:04.435: I/WindowManager(99): WIN DEATH: Window{45041b28 SurfaceView paused=false}
    01-20 10:18:04.435: I/ActivityManager(99): Process com.chainelsbv.androidplayer (pid 5549) has died.
    01-20 10:18:04.445: E/ActivityManager(99): fail to set top app changed!
    01-20 10:18:04.445: I/WindowManager(99): WIN DEATH: Window{4500ff70 com.chainelsbv.androidplayer/com.giderosmobile.android.CHAINelsActivity paused=false}
    What's happening? A call to media:isCameraAvailable() is working fine...
    @Venorcis just tried it out on HTC Desire Android 2.2 and it is all working great, so will need more logs to understand where is the problem, or send me your project and I can check it out ;)
  • @ar2rsawseen With version 0.2, it (almost) works perfectly as well now.
    Just 1 glitch: the app crashes with 'bad argument #1 to addEventListener' on calling 'mediamanager:addEventListener(Event.MEDIA_RECEIVED, function(e)'; did the name of the Event.MEDIA_RECEIVED change perhaps?
  • Yes, sorry
    Events

    Event.MEDIA_RECEIVE --user selected image
    e.path -- path to image

    Event.MEDIA_CANCEL --user canceled media input
    Event.VIDEO_COMPLETE --user completed watching video
  • Is it possible to make resize works as fit full width and height(stretch)? What should i do for that?
    For example if i want to post photo from 10 to 210 px width and from 10 to 310 px height?
  • And why it can bring me blank screens?
    After mediamanager:takeScreenshot() it brings me screens like attached.
    20140126_224206_gideros.png
    480 x 821 - 4K
  • On mine (samsung S3) it grabs a screenshot, but does not add it to the gallery, instead it's in a folder on the phone in this directory...

    mtp://S3/Phone/Android/data/com.sinistersoft.martians/files

    Here is the code:

    mediamanager:addEventListener(Event.MEDIA_RECEIVE, function(e)
    mediamanager:postPicture(e.path)
    end)

    Is postPicture not supposed to move it to the Gallery?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    edited January 2014
    @unlying
    1) hmm, did not think someone would want to stretch pictures without the fixed aspect ratio, will need to update API to include it

    2) interesting, it can be either something video card specific or rendering specific. What are you showing on screen exactly, when taking screenshots on your pc?

    @SinisterSoft
    3) not exactly, I launch an intent to scan specific file from the same folder and add it to media gallery (seems to be more like indexing), but I like the idea of copying it to public folder, so you can mess the version you have privately in your app folder, let me also fix that ;)
  • 1) Yes, thanks i really need this.
    2) I press on takescreenshot after inserting picture. So it has some buttons, text and picture.
  • @unlying then it means it can't capture GLSurface. Interesting. Can you give any PC specifics? OS version, CPU, Video card?
  • SinisterSoftSinisterSoft Maintainer
    edited January 2014
    Is the file not saved until you do the postPicture (is it held in memory?) - if not then where is it before postPicture? Will the storage not get clogged up (within the app data folder)?

    Also dropbox does not see the photos - because they are not in the Gallery - so getting them out of the phone is little difficult.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • ar2rsawseenar2rsawseen Maintainer
    edited January 2014
    For now I think it should work like this:

    Taking picture from camera, creates file in app folder
    Taking screenshot creates file in app folder
    Getting picture from gallery, copies picture in app folder (so you won't mess up the original picture)
    Posting picture should copy it to public folder and index for gallery (will implement it soon)

    That means there should also be a method delete, to delete the file

    And about memory, then
    Media object, as in:
    local m = Media.new("path/to/pic.png")
    will hold the image in memory, so the methods as resize or set/get pixels would work efficiently, and when the m object gets garbage collect, the memory is freed
  • That would be good. :)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • @ar2rsawseen
    Windows 7 32-bit
    AMD Phenom-II X4 965 3.4GHz
    AMD Radeon HD 6900

    It takes blank screens even on provided example.
  • @unlying ok thanks, will check more specific hardware details
  • @ar2rsawseen Great work on all the plug-ins; we're really using the android bridge, notifications and media plug-ins heavily, works like a charm!
    We would also love to use the announced reporting plug-in when we would be able to get an overview of any error (internal ok, but lua especially) that might occur in our app at users. Is there any indication of when this might be available possible? Thanks!
  • What options do we have to share screenshot?
    Facebook using facebook plugin?
    Tweeter, vkontakte, e-mail, pinterest?
  • ar2rsawseenar2rsawseen Maintainer
    edited January 2014
    @Venorcis the Gideros reporting itself might not come soon, because of some problems (ios specific) with the desymbolication of error reports (need a Mac server for that), but Lua errors should come independently of that, most probably in the next release (or the one after that)

    @unlying yes the new FB SDK I'm working on already has the ability to post pictures.
    (https://www.facebook.com/photo.php?fbid=695884360457614&set=a.695884347124282.1073741828.100001081690027&type=1&stream_ref=10)
    Other option I'm thinking on is to provide a way to get byte string to upload it to your server using UrlLoader or sockets.
    Most probably in a similar way there could be a way to upload it to other sites you have mentioned ;)
  • My app with Media and Facebook plugin https://play.google.com/store/apps/details?id=com.debia.loveisphoto

    Previous answer about uploading image to own server is nice, but doesn't helpful with uploading screenshot to vkontakte, twitter and else.

    What options do we have with iOS?

    Btw, corona has builtin twitter now: http://coronalabs.com/blog/2013/02/11/using-the-ios-built-in-twitter-feature/
  • Great,
    added lots of new image manipulation features in Media, now basically testing them all out on all platforms and will publish soon.

    The problems with twitter is that it does not have an SDK, thus it uses only REST API, meaning, there could be a crossplatform twitter lib in plain lua, in that case provided uploading example will fit the best.

    I have no idea about VK, if they have a SDK or REST API?

    The dialog on IOS is great, but it is IOS only. Support such platform specific would only fragment the code api, thus I think such additions could be left to plugins. But honestly if it is not a crossplatform solution, I would rather not waste a time on such plugin
  • @unlying, in 09/09 (sep/09) I had posted this http://howto.oz-apps.com/2012/09/tweet-tweet-right-from-your-lua-app.html

    this was using twitter (native) via Gideros using Wax, making a plug-in for just twitter or the social API, is easy, as this second article posted http://howto.oz-apps.com/2012/10/teaser-using-facebook-with-gideros-plug.html shows.

    cheers,

    BTW: I love your love is app. I used to follow the comic strip as a child and then when I could find it.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Updated Media plugin:

    version 0.3
    Full Windows support
    Full Mac support
    Added resizing without fixed aspect ratio
    Added deleting file
    Added set/getRotation for image
    Added trim support based on color
    Added create empty image with dimensions
    Added draw one image on another
    Added draw line
    Added draw text
    Added flip image Horizontal/Vertical
    Added setPixel additionally can be done using hex value for rgb
    Fixed compatability with encrypted files
    Fixed taking screenshots (Windows/Mac)
    Fixed posting picture Android
    +1 -1 (+2 / -0 )Share on Facebook

  • I have no idea about VK, if they have a SDK or REST API?
    http://vk.com/dev/main

    that outlines all about the way a developer can connect to VKontakte
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • foldedfolded Member
    edited February 2014
    In case the path (e.path) from Event.MEDIA_RECEIVE contains unicode, the unicode gets replaced with "??".

    e.g.)

    C:/Users/??/AppData/Local/Temp/gideros/mediafiles/20140204_231814_gideros.png

    Is there any way to avoid this case except "do not use any unicodes in your directory name"?
  • How to send e-mail with image attachment from gideros?
    We can use this to send mail application:openUrl("mailto:unlying@gmail.com?subject=Test&body=Test")
    How to attach?
Sign In or Register to comment.