use-livecode Digest, Vol 115, Issue 21

MacBox at earthlink.net MacBox at earthlink.net
Thu Apr 11 13:08:29 EDT 2013


Thanks, Devin, but no luck there either, I'm afraid, still a grey img object.

Perhaps worth adding: another of their APIs returns a jpg, and that works fine which is also why I think it's likely the mask data in the gif data stream that is causing the issue.

On Apr 11, 2013, at 13:00 PM, use-livecode-request at lists.runrev.com wrote:

> On Apr 11, 2013, at 10:43 AM, <MacBox at earthlink.net>
> wrote:
> 
>> I'm attempting to get a traffic gif from mapquest via their RESTful API, but I am unable to display it; everything results in the image object displaying a grey pattern.
>> 
>> Some of the things I have tried so far:
>> 
>> set the text of img "map" to url MapQuestsLongAPIKeyedURL
>> 
>> set the imageData of img "map" to url MapQuestsLongAPIKeyedURL
>> 
>> put url MapQuestsLongAPIKeyedURL into img "map"
>> 
>> get url MapQuestsLongAPIKeyedURL
>> put it into url (binfile:LocalFilePath)
>> set the filename of img "map" to LocalFilePath
>> 
>> What's interesting is that the saved file from that last attempt will display in Finder via QuickLook, and open up in Preview as well without issue. If I then re-save the file from Preview, THAT file will load into a LiveCode image object (Note: oddly, if I open and save the file from Safari it will not load properly)
>> 
>> I'm guessing that the problem is that I'm trying to dump both the Gif's image and mask data all into the image object, while QuickLook, Finder, Preview, and even Safari know how to reassemble them properly as image and mask data for display.
>> 
>> Does anyone have any ideas for getting this incoming Gif data into an image object properly? Thanks!
> 
> 
> Try this:
> 
> Set the filename of image "map" to MapQuestsLongAPIKeyedURL
> 
> This works, for example, with the Google Static Maps API.
> 
> Devin
> 
> 
> Devin Asay
> Office of Digital Humanities
> Brigham Young University




More information about the use-livecode mailing list