Raw Binary Date to Image File

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
PMLaura
Posts: 12
Joined: 2013-04-23T22:15:25-07:00
Authentication code: 6789

Raw Binary Date to Image File

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Raw Binary Date to Image File

Post by magick »

Post a URL to one or two sample XML files. We'll need to inspect them before we can comment.
PMLaura
Posts: 12
Joined: 2013-04-23T22:15:25-07:00
Authentication code: 6789

Re: Raw Binary Date to Image File

Post 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
PMLaura
Posts: 12
Joined: 2013-04-23T22:15:25-07:00
Authentication code: 6789

Re: Raw Binary Date to Image File

Post 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>
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Raw Binary Date to Image File

Post 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.
Post Reply