I have a BASE 64 image string being sent to my app via a REST API.
Can anyone suggest the easiest way to take that string and convert it to an Aware IM Picture Attribute please?
BASE 64 Image string to Aware Picture
-
- Posts: 2407
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
BASE 64 Image string to Aware Picture
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Re: BASE 64 Image string to Aware Picture
Mark,
Do you have any control on how the data is being sent to your app?
The data needs to be in a specific format.
see: https://www.awareim.com/forum/viewtopic ... 66&p=54462
If you have no control on the incoming data, you will probably need a plugin.
Do you have any control on how the data is being sent to your app?
The data needs to be in a specific format.
see: https://www.awareim.com/forum/viewtopic ... 66&p=54462
If you have no control on the incoming data, you will probably need a plugin.
Bob
-
- Posts: 2407
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: BASE 64 Image string to Aware Picture
Well, looks like it can be done in Python.
While I already call some Python code in my app but am not sure how to run a Python script from Aware that takes parameters.
Any ideas would be really appreciated please.
While I already call some Python code in my app but am not sure how to run a Python script from Aware that takes parameters.
Any ideas would be really appreciated please.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Re: BASE 64 Image string to Aware Picture
what i would do is make a batch program to call python.
and test it from the command line outside of aware. cleaner and gets rid of quoting issues and parameter passing challenges.
(and it would work better in powershell, than batch files, from my experience.)
here's an example to run imagemagick passing some parms:
EXECUTE PROGRAM SystemSettings.DQ + 'c:\Program Files\ImageMagick\magick.exe' + SystemSettings.DQ + ' ' + EstimatePictures.PicPath + ' -rotate 90 ' + LoggedInStaffMembers.tmp_Filename
and test it from the command line outside of aware. cleaner and gets rid of quoting issues and parameter passing challenges.
(and it would work better in powershell, than batch files, from my experience.)
here's an example to run imagemagick passing some parms:
EXECUTE PROGRAM SystemSettings.DQ + 'c:\Program Files\ImageMagick\magick.exe' + SystemSettings.DQ + ' ' + EstimatePictures.PicPath + ' -rotate 90 ' + LoggedInStaffMembers.tmp_Filename
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: BASE 64 Image string to Aware Picture
powershell:
EXECUTE PROGRAM 'powershell -File C:\users\jaymer\cars\login.ps1' + AA.theRegID
So now you are starting PS telling it to run a PS program, with an input parm
EXECUTE PROGRAM 'powershell -File C:\users\jaymer\cars\login.ps1' + AA.theRegID
So now you are starting PS telling it to run a PS program, with an input parm
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: BASE 64 Image string to Aware Picture
As usual, the Server Output window will be your friend.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
Re: BASE 64 Image string to Aware Picture
In the latest build 3136 it is possible to convert the data using a simple assignment:
Object.PictureAttribute = Object.StringAttributeThatHasBase64Image
Object.PictureAttribute = Object.StringAttributeThatHasBase64Image
Aware IM Support Team