Display picture

Doug Easterbrook doug at artsman.com
Fri Jan 27 09:51:26 EST 2017


hi David:

As with all things anyplace, the mileage varies depending on …..   (ok, thats the disclaimer).

We are using studio 5.3.2.1 — and have been for a fair while.

Pictures that we had in the databases from omnis.df1 days were stored as picts  in a field for mac’s and EMF/WMF in a separate pict field for windows.   I don’t recall having pictures in the database for other purposes (since they make df1 really huge).


We added pictures to our database where the technology was studio and postgres.  I think we AVOIDED shared picture format as our library setting is kSharedPictModeNone …


what do I know??

I did have some pictures in the database that seemed not to display and when you insepect themusing the pictformat, you could see PNG, CS24 (24 bit omnis shared format, I think) CS8, JPEG and others per the list from the online help below.

I wrote this small bit of code to convert pictures that were in some format other than jpeg or png to convert things..   its not sophisticated, but it converted those that could and killed those that couldn’t be converted.


Calculate pictformat as pictformat($cinst.PP_PICTURE)
If isclear(pictformat)
Breakpoint {what kind of picture}
Calculate $cinst.PP_WEB_PICTURE as #NULL
Else If pos(pictformat,'JPEG,PNG')
Calculate $cinst.PP_WEB_PICTURE as $cinst.PP_PICTURE
Else
Calculate $cinst.PP_WEB_PICTURE as pictconvto(pictformat,$cinst.PP_PICTURE,'PNG')
End If




Others have pointed out that pictures in omnis MAY have a wrapper around them.   At one time in our lives, we needed to discover that and I recall working with Kelly to identify the bytes that omnis put in front of shared picture format.     The way we did it was to use a tool like hexedit to have a source file (jpeg) and a shared picture format file and do a binary compare to find out what omnis put at the front of the picture when stored in a df1.   this was some 10 or 12 years ago, so I don’t remember exactly what we did …     but the gist is

 — get a jpeg
- put in shard picture format
- get the binary from the shared pict format
- compare using hexedit (a tool on the mac - open source)
- found out that the first 100 -ish bytes are a omnis wrapper
- strip off the omnis wrapper
- may need to inject some JPEG identidier (I don’t recall this exactly)..

and I think you get your picture back


it was work to figure it you, but it was possible.   The reason I say that is because we recovered shared picture format pictures (PICTS and WMF’s)  from a DF1 during our conversion to postgres and got them into non-shared picture format.


thats what I know.   its fiddly and in the byte code kind of work …  a bit of head banging ..   but perseverance helped and we got what we needed and a process to convert it.








CS8 - Omnis colour shared picture format (256 colours), including the internal Omnis header.
CS24 -Omnis colour shared picture format (16 million colours) , including the internal Omnis header.
PNG - PNG (Portable Network Graphics) format (Raw, as written on disk)
CSC8 - This is a 256 colour compressed format, which is an 8 bit PNG rather than 24 bit PNG format. Ideal for situations where images must have additional compression e.g. for downloading to the Omnis Web Client. Obviously, this format may reduce the colour detail of an image that was originally 24 bit.
JPEG - JPEG format (Raw, as written on disk)
PCX - PCX format (Raw, as written on disk)
WBMP - Wireless bitmap format, the standard format for Wireless Application Protocol (WAP) devices (Raw, as written on disk).



Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On Jan 26, 2017, at 4:18 PM, David Ferri <davidferri at icloud.com> wrote:
> 
> Hi Doug,
> 
> We’re struggling with this as well. We have pictures stored in a SQL Server database that were most likely added by an Omnis 7 and/or Studio application with shared picture format turned on. Applying the pictformat() function returns a blank. We looked at the headers and nearly all of the pictures start with 00 04 which Kelly tells us he doesn’t recognize. In the old Omnis 7 documentation is states quite clearly that once set to shared picture format there is no going back. So where you say "you could use omnis to convert it from shared picture format to jpg or png” how would we do that?
> 
> Regards,
> David Ferri, President
> Word Master, Inc.
> 320 Earls Ct.
> Deerfield, IL  60015
> Ph: 847-948-9600
> Cell: 847-922-0080
> Fax: 847-948-9617
> http://www.wordmaster.com <http://www.wordmaster.com/>
>> On Jan 16, 2017, at 9:28, Doug Easterbrook <doug at artsman.com> wrote:
>> 
>> hi Dhulhum.
>> 
>> I suspect completely depends on the format you saved it in.   IF you viewed the picture in omnis — its probably in some omnis shared picture format and not the jpg or png thart you think it is.
>> 
>> if it is omnis shared picture format — then is compatible only with showing on omnis in mac or window — and there is no conversion (that I know of) that lets other applications use it natively.
>> 
>> but you could use omnis to convert it from shared picture format to jpg or png .. and then store that in the database — which might help you get it out with .net.
>> 
>> 
>> thats my suspicion.       the omnis ‘pict’ commands such as pictconvto and pictformat might give you clues.
>> 
>> 
>> 
>> Doug Easterbrook
>> Arts Management Systems Ltd.
>> mailto:doug at artsman.com
>> http://www.artsman.com
>> Phone (403) 650-1978
>> 
>>> On Jan 16, 2017, at 7:20 AM, Dhulhum Khan <dhulhumkhan at gmail.com> wrote:
>>> 
>>> Hi all,
>>> 
>>> 
>>> 
>>> I have saved an image in oracle database from omnis studio application.
>>> 
>>> I have been given a task to fetch the same picture(BLOB) in .net
>>> application which was saved to oracle database from omnis studio 5.2
>>> application.
>>> 
>>> I am not able to display picture. It is giving invalid value error.
>>> (ArgumentException (parameter is not valid) in .net application).
>>> 
>>> 
>>> 
>>> Can anyone help please.
>>> 
>>> 
>>> 
>>> Regards,
>>> 
>>> Dhulhum
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com



More information about the omnisdev-en mailing list