O$5.1.1 Loading image file to a variable using HTTPRead.

Mike Matthews omnis at lineal.co.uk
Tue Jul 4 03:22:41 EDT 2017

Thank Kelly,

It was while looking at the file data that I saw plenty of references to Adobe, etc.  Embedded stuff that I thought was very odd.

I'll try your code next, so thank you.

I have also now played with the v8.1b3 oBrowser, which was quite easy to get it to show different URL in the window.  And there is an option to $startdownload(), but over the time that I ran it, Studio went BOOM on my Mac, so after 5 times of this I went to bed.  I am using the v8.1b3 however, so it may be that, but the docs aren't quite as helpful.

I dod like the new way of tooltips as you type the commands in, quite odd at first, and a lot to take in for the first time.  But I like, as it gives you all of the arguments, but could still be a bit better I feel.


Mike Matthews, Managing Director, Lineal Software Solutions Ltd

Apple Reseller, Microsoft Partner, SQLWorks Business Partner
phone: 01271 375999 | web: lineal.co.uk <http://www.lineal.co.uk/> | email: mike.matthews at lineal.co.uk <mailto:mike.matthews at lineal.co.uk>
> On 4 Jul 2017, at 08:13, Kelly Burgess <kellyb at montana.com> wrote:
> Hi Mike,
>> Has anyone an easier, more workable solution to retrieving an image from a website please?
> Easier than what?
> The code below pulls a jpg file into a picture field.  At the line 'Calculate iPicture as binField' you could do WriteBinFile(path,binField) instead.  Works in Studio 4.3.1 with http urls, works in Studio 5 and up with https urls.
> But the url you cited isn't a normal JPG, it's some kind of photoshop format starting with FFD8 like a normal jpg, but then FFED which is I don't know what - so save to file will work, but showing it in an Omnis picture field may not.
> Hope it helps,
> Kelly
> -----------
> Calculate url as 'http://www.kellyb.com/RosettaOnLion.jpg'
> HTTPPage (url) Returns binField
> Calculate size as binlength(binField)
> If size>0
>  Calculate headerBreak as binfromhex('0D0A0D0A')
>  Calculate pos as binsearch(headerBreak,binField)
>  If pos>0
>    Calculate binField as bytemid(binField,pos+4,size-1)
>    Calculate iPicture as binField
>    Do $cinst.$objs.dfPicture.$rawpictformat.$assign(pictformat(iPicture))
>    Redraw {dfPicture}
>  End If
> End If
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com

More information about the omnisdev-en mailing list