FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour More on graphic storage / evaluation
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
More on graphic storage / evaluation
Posted: Tue Oct 13, 2015 11:33 PM
Last week I was working with a JPG file, and managed to store it in a memo field. It was a signature captured by a credit card terminal.

Now I have a different service provider, and they return a string (Base64 encoded ) which is supposedly in .jpg format:

Code (fw): Select all Collapse
SUkqAHYBAACAP+BQOCQWDQeEQmFQuGQ2HQ+IRGJROKRWLReMRmNRuOR2PR+QSGRSOSSWTR93xkHxh8N+MIcfxg/RhwP6MB9+w8ATsPwR4P9xw5gQNzwRnv+XQxATGBPuBviY0mFAA/wR7wNDwKmQl8Qajv9+VV+Qt/AeDUx502FsGDTaBSl/1eEv6twO2QKk3KEOG2gCzP+mV+EJ+DUOnW5/r+FVWCXR/06cwLGQexwWhv+c5F/ZODU6BPwHvie4/MQLIwjPP4B2mB1fI6eD5586WB3C1Ql+D9+WbEP/BaR/uCC4p/sABwPJ4SB054B/Ocrh8iCPgwSviQrib2BcrrwniZWD92F6yD3WF7aDVVAZyEJ6ETZ8eyDv4A++4wx8VSETmVwqyqKhB8p+hb6qkgx5v6hLhMA3CyJ7AaKLu36JKY8yILcrqKtmf8AIoop/NGiiUr4iyUwMk8URTFUVxZFsXRfGEYxlGcaRrG0bxxHMdR2jaAgOAP4ABAABAAAAAAAAAAABBAABAAAA0AAAAAEBBAABAAAAcAAAAAIBAwABAAAAAQAAAAMBAwABAAAABQAAAAYBAwABAAAAAQAAABEBBAABAAAACAAAABUBAwABAAAAAQAAABYBBAABAAAAcAAAABcBBAABAAAAbgEAABoBBQABAAAAJAIAABsBBQABAAAALAIAACgBAwABAAAAAgAAAD0BAwABAAAAAQAAAAAAAAAAdwEA6AMAAAB3AQDoAwAA


The code section is the value they provide me. So, I need to convert the Base64 encoded string and save it as a .jpg which I can then read into my memo file. Once I have it in .jpg format, the rest is already done.

My other vendor provided a simple call that converted their string and saved it as a .jpg. In this case, I need to do it using harbour/xharbour functions.

Your thoughts would be appreciated.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: More on graphic storage / evaluation
Posted: Wed Oct 14, 2015 01:28 AM

memowrit( 'image.jpg', hb_base64Decode( cData ) )

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: More on graphic storage / evaluation
Posted: Wed Oct 14, 2015 04:46 PM

Thank you Gale. I am now 100% with this working.

I wonder how many people are actually integrating credit cards into the system.

I believe you indicated you are using a tablet signature system ? Does it simply show a line on which to sign, or does it actually show the signature on the screen as it is being performed ?

I looked at signature pads, but they appeared to be quite expensive.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: More on graphic storage / evaluation
Posted: Wed Oct 14, 2015 05:09 PM

I am doing it on the screen and they can use finger or pen. I started with signatur.prg in the samples folder.
There were some issues (not major) but I modified it and it is working pretty good.
I started out by just saving the signature in memo field but later found that it worked better for our imaging system if I saved the whole receipt as image and then import into imaging system.
I modified the print/preview system so that it uses part of the meta file creation of print preview and converts the meta file to jpg images so I can import them into the imaging system.
It now prints receipt and saves the image at the same time.

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: More on graphic storage / evaluation
Posted: Wed Oct 14, 2015 05:56 PM

Very nice. I'm thinking I may add a linked file just for the signatures since I don't want to risk problems with the main order file.

Where did you run into problems ?

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: More on graphic storage / evaluation
Posted: Thu Oct 15, 2015 12:55 PM

The inking would get confused sometimes. If you moved outside signature area with button down it would not recover well. If you want my updates let me knw.

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: More on graphic storage / evaluation
Posted: Thu Oct 15, 2015 09:07 PM

I'd love to see your updates, and work with it.

Email is tim at gtstone dot com

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit

Continue the discussion