makeImageRequest not responding

Trying to use the new makeImageRequest function implemented as part of SDK 1.2.0, fetching a simple png image (256x256 pixels). I get no error message. However, function in responseCallback is never called. Also strange is that the quick-tip in Eclipse says makeImageRequest take three parameters, whereas the documentation online talks about four.

Comm.makeImageRequest("http://adress.png", {}, method(:onReceive));

(In a browser the picture is shown without problems)

Anyone who has made this work?
  • Trying to use the new makeImageRequest function implemented as part of SDK 1.2.0, fetching a simple png image (256x256 pixels). I get no error message. However, function in responseCallback is never called. Also strange is that the quick-tip in Eclipse says makeImageRequest take three parameters, whereas the documentation online talks about four.

    Comm.makeImageRequest("http://adress.png", {}, method(:onReceive));

    (In a browser the picture is shown without problems)

    Anyone who has made this work?


    I'd expect the doc to be correct - if it says "1.2.0" then for sure it is.

    Are you trying this in the simulator or the watch itself? Some things like this might not work from the watch until GCM is updated (I saw a post about that being the case for the new options for makeJsonRequest() )
  • Trying to use the new makeImageRequest function implemented as part of SDK 1.2.0, fetching a simple png image (256x256 pixels). I get no error message. However, function in responseCallback is never called. Also strange is that the quick-tip in Eclipse says makeImageRequest take three parameters, whereas the documentation online talks about four.

    Comm.makeImageRequest("http://adress.png", {}, method(:onReceive));

    (In a browser the picture is shown without problems)

    Anyone who has made this work?


    Which online documentation mentions makeImageRequest()? This wasn't released for the 1.2.0 SDK beta, so I'm wondering where you found the documentation. The Eclipse documentation was something that we didn't catch, and it'll be updated for when makeImageRequest() is supported.
  • Would be great to get an example of how this works, maybe with a sample app or just with a code snippet (when timing is right for Garmin).
    I'm not sure about how to handle the image when it's delivered in the callback function.
  • I think he's talking about this:
    http://developer.garmin.com/connect-iq/programmers-guide/communication/


    Precisely.

    Fully agree, would be great to have an example of how to use this. Seems straight forward, but as stated I obviously did not even get the response function to get triggered. I have only tried in the simulator. I assume this should still work, and that my MacBooks internet-connection is used instead of the watch communicating via the phone. Correct, or do I need to deploy to the watch first?
  • Your original snippet...

    Comm.makeImageRequest("http://adress.png", {}, method(:onReceive));


    The documentation you reference from the developer site...

    // To request an image through Garmin Connect Mobile, call makeImageRequest(). GCM
    // will scale and dither the image based on the capabilities of the device, but
    // the user will be able to pass additional options (like dithering it down to a
    // one color image)
    // @param [String] url URL of image to request
    // @param [Dictionary] parameters Dictionary of keys and values, appended to the
    // URL. Can be null.
    // @param [Dictionary] options Additional image options
    // @option options [Array] :palette The color palette to restrict the image dithering to.
    // Using a smaller palette can reduce the size of the image data to speed up
    // transfers.
    // @option options [Number] :maxWidth The maximum width an image should be scaled to
    // @option options [Number] :maxHeight The maximum height an image should be scaled to
    // @option options [Number] :dithering The type of dithering to use when processing the
    // image. Dithering defaults to Floyd-Steinberg.
    // @param [Method] responseCallback This is a callback in the format function
    // responseCallback(responseCode, data); responseCode has the server response code,
    // and data contains a WatchUi.Bitmap if it was successful.
    function makeImageRequest( url, parameters, options, responseCallback );


    At the very least, you're not passing the right number of parameters. As mentioned above, the function isn't in the 1.2.0 SDK documentation, so I don't know what you'll get if you do try to use it. I know it was there in previous SDK versions, but it was never fully working.

    Travis
  • We probably should have left makeImageRequest() out of the documentation for now because it's not fully working yet, but it is still planned for the 1.2.0 release. Apologies for the confusion.
  • Hi,
    I'm trying to use makeImageRequest but for now I'm unsuccessful.

    Could anyone give an example of the request, the callback, and the use of the image?

    More specifically, how to use the options?
    Options Hash (options):
    :palette (Array) — The color palette to restrict the image dithering to. Using a smaller palette can reduce the size of the image data to speed up transfers.
    :maxWidth (Number) — The maximum width an image should be scaled to
    :maxHeight (Number) — The maximum height an image should be scaled to
    :dithering (Number) — The type of dithering to use when processing the image. Defaults to Floyd-Steinberg.

    I don't understand the syntax for requesting a palette and a dithering.

    Thanks,
    Julien
  • Now this is available in 1.2.x has anybody got it working?

    I can make the makeImageRequest call ok, and get back data (which when checking the getHeight() and getWidth() are ok).

    However when I use drawBitmap I get nothing.

    Any ideas?

    Cheers
    Chris
  • Ok, weird, it's now working!

    I will keep you posted, on any changes.