Page 1 of 1

Raw Binary Date to Image File

Posted: 2014-02-13T23:57:13-07:00
by PMLaura
Hi there

We will soon be receiving some XML files that basically contain raw binary image data that then need to be converted into the actual image file including the metadata also contained in the same XML file.

Is this something ImageMagick can handle? I've had a quick look around and there seems to be some references to raw data but i'm not 100% sure what I'm looking for either.

Thanks much for your time

Regards
Laura

Re: Raw Binary Date to Image File

Posted: 2014-02-14T06:45:21-07:00
by magick
Post a URL to one or two sample XML files. We'll need to inspect them before we can comment.

Re: Raw Binary Date to Image File

Posted: 2014-02-16T17:40:40-07:00
by PMLaura
Thanks for your response, just as soon as I have one I will post it.

Can you give me some idea of what IM is capable of in regards to this sort of thing? We are investigating various means of generating the image and this is one of them.

Thanks again
-- Laura

Re: Raw Binary Date to Image File

Posted: 2014-02-16T19:33:35-07:00
by PMLaura
Here's a sample of the XML with the image data truncated, I can email/post the actual xml somewhere if required didn't want to mess up the board with masses of garbage.

Thanks for any assistance

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<MLW Cmd="35" TStamp="2014-01-31T04:49:07" Id="n07" OrgId="750487691" DevId="353575050957244" RouteId="2352:8250" TruckId="N07" StopId="123931" LocationKey="27337" LTStamp="2014-01-31T15:49:07" GroupName="xxxxx" GroupId="2160" SType="3" Name="xxxxx" LocationAddress="xxxxx" LocationCity="xxxxx" LocationState="xxxx" LocationPostalCode="xxxx">
  <FieldData LCode="2" OwnerId="222561">
    <Field FId="3199" Name="Image" Value="ffd8ffe000104a46494600010100000100010000ffdb00430003020 …..<truncated>…. f00f5d1450f710f5184233d2a56e2107032dd78a28abec23fffd9" />
  </FieldData>
  <Job Id="222561" JobId="222561" JType="3" Status="4" Name="xxxxxx" DispID="XXXXX">
    <Item ItemId="225583" Status="4" Key="" Name="" />
  </Job>
  <Job Id="222571" JobId="222571" JType="3" Status="3" Name="xxxxxx" DispID="XXXXX">
    <Item ItemId="225593" Status="3" Key="" Name="" />
  </Job>
  <Job Id="222573" JobId="222573" JType="3" Status="3" Name="xxxxxx" DispID="XXXXX">
    <Item ItemId="225595" Status="3" Key="" Name="" />
  </Job>
</MLW>

Re: Raw Binary Date to Image File

Posted: 2014-02-17T06:08:09-07:00
by magick
Your image is likely base-64 encoded. ImageMagick can read inlined base-64 encoded images from the command line, for example:
  • convert inline:<your base-64 encoded inlined image here> image.png
It cannot read it from your XML file because base-64 encoded images are not part of the XML standard. They are typically embedded in application specific elements.