Is it possible to view IPTC data in a hex-viewer? - image

I have been trying to examine a JPEG file, known to contain IPTC data, but could notice no strings whatsoever. I tried the well known UNIX strings command, ASCII, 8-bit, 16-bit Unicode --- to no avail: I could not see any strings that I expect to find in IPTC fields.
My question is: How is IPTC data encoded? Is it encrypted? Compressed? Other? Why can't it be viewed using the strings command?

The most probable reason why you cannot view IPTC data using a hex viewer is because it has no IPTC data.
An image that contains IPTC data like this one:
http://regex.info/exif.cgi?dummy=on&imgurl=https%3A%2F%2Fwww.iptc.org%2Fstd%2Fphotometadata%2Fexamples%2FIPTC-PhotometadataRef-Std2014_large.jpg
has an XML structure and text fields that are view-able through a text editor like Emacs (8-bit, not even Unicode).

Related

Conversion of srd3 format in ascii for processing in QGIS

I am given a dataset containing radar observations in srd3 format. The file is a plain text file containing points, ergo a raster file. A sample looks like this
What I want is to implement it in QGIS.
I gave it a standard ascii format in order to import in QGIS, after converting the values
However it doesn't process the values at all
I am aware that spaces should be included in the format but didn't work either. The procedure should be simple, but something is missing
Any suggestions ?

Downloading open street map data in pbf format

I want to download data of a specific area from open street map. Whenever I try to export from openstreetmap.org it downloads the data in .osm format but I want the data to be in .pbf format. I have tried converting .osm file to .pbf file using osmconvert.exe but whenever I try to open the converted file in a text editor ( geany to be specific) it shows nothing. But when I tried opening the converted file in vim there was something but not readable. Can someone suggest me a way to download the data of specific area from open street map in readable pbf format?
For downloading area specific OSM files I would like to recommend the service of Geofabrik:
http://download.geofabrik.de/
The format .osm usually is human-readable since it's XML-structured text.
The format .pbf is not human-readable because this is a binary format. PBF-formatted OSM data are highly compressed and need to be converted (for example to .osm or to .csv) before you can read them.
Further information can be found in OSM Wiki:
https://wiki.openstreetmap.org/wiki/OSM_XML
https://wiki.openstreetmap.org/wiki/PBF_Format

extract images from HL7 files

Given a HL7 file which I know that in its TXA segment there's a byte code of an image, how can I extract that image?
I know my question might be blurry, but that's the details I have
EDIT: The TXA segment is as follows:
TXA|1|25^PathologyResultsReport|8^HTML|||||||||||||||||||908^מעבדת^פתולוגיה^^^^^^^^^^^^20110710084900|||PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgU3RyaWN0Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXN0cmljdC5kdGQiPg0KPGh0bWw+PGhlYWQ+PG1ld...
+PGJyLz48L3RkPjwvdHI+DQo8dHI+PHRkPg0KPC90ZD48L3RyPg0KPC90Ym9keT4NCjwvdGFibGU+DQo8L3RkPjxTb2ZUb3ZOZXdDb2x1bW4gLz48L3RyPjxTb2ZUb3ZOZXdMaW5lIC8+DQo8L3Rib2R5Pg0KPC90YWJsZT4NCjwvYm9keT4NCjwvaHRtbD4NCg==|
Thanks in advance
From reading the documentation it appears that images are stored in this form:
OBX||TX|11490-0^^LN||^IM^TIFF^Base64^
SUkqANQAAABXQU5HIFRJRkYgAQC8AAAAVGl0bGU6AEF1dGhvcjoAU3ViamVjdDoAS2V5d29yZHM6~
AENvbW1lbnRzOgAAAFQAaQB0AGwAZQA6AAAAAABBAHUAdABoAG8AcgA6AAAAAABTAHUAYgBqAGUA~
YwB0ADoAAAAAAEsAZQB5AHcAbwByAGQAcwA6AAAAAABDAG8AbQBtAGUAbgB0AHMAOgAAAAAAAAAA~
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAP4ABAABAAAAAAAAAAAB~
(681 lines omitted)
1qqQS/cFpaSVeD1QP1/SX1VJfpPSfXr+tIOKrN2aSrB8OHoH1kfz2tnPLpB/6WkksJ0w5G6WKVNe~
vSisJQdhLdQjODpbznVXXDMPdBNhVtBNpOqqtkY60qYoJxQK17cUoS0v4ijYztCapqqYUKmIUJhJ~
sKqoIO2opiqr7lupIMFBBhNQmtOIzG4naS7XsQuDBLFOP/gAgAgAAKMHAACcBgAACRcAALcYAAC4~
EwAA5RoAALQXAADyBAAAnAMAAD8LAADbEQAA5CgAAJtBAABTVQAAOHAAAOyHAAA=|||||||F
This looks like a simple structure, where the image data is base64 encoded and stored as a long stream, you know its an image because it has ^IM and the image type because of ^TIFF
More specifically:
When an image is sent, OBX-2 must contain the value ED which stands for encapsulated data. The components of OBX-5 must be as described below.
The first component, source application, must be null.
Component 2, type of data, must contain IM, indicating image data.
Component 3, data subtype, must contain TIFF
Component 4, encoding, must contain Base64
Base64 encoding of non-structured (standard HL7) data, normally in an OBX (but could be anywhere) is the norm. Older systems may have a 32K or 64K byte limit, and when that happens the data will be spread over multiple segments.
The target system will first have to potentially concatenate multiple segments and then decode the Base64 encoding.
The target system must know what the expected data type is so that it can be properly displayed or further decoded/interpreted.
This would be a great question on our new StackExchange site for IT Healthcare: http://area51.stackexchange.com/proposals/51758/healthcare-it

FTP batch report with chinese characters to excel

We have a requirement to FTP the batch report to a excel sheet in .csv format. The batch report contains both single byte and double byte characters, for example, English and Chinese. The data in mainframe is in Base64 format and when this is FTP’ed in either Binary or ASCII mode, the resulting .csv spreadsheet shows only junk characters. We need a method to FTP the batch report file, so that the FTP’ed report is in readable format.
Request your help in resolving this issue.
I'm not familiar with Chinese character sets but I would think if you're not restricted to CSV, you might try to format an XML document for excel whereby you can specify the fonts as part of the spreadsheet definition.
Assuming that isn't an option I would think the Base64 format might need to be translated to ASCII (from EBCDIC) before transmission and then delivered in BINARY. Otherwise you risk having the data translated to something you didn't expect.
Another way to see what is really happening is send the data as ASCII and retrieve the data as BINARY and then compare the before and after results to see what characters were changed enroute during transmission. I recall having to do something similar to this once to resolve different code sets in Europe vs. U.S.
I'm not sure any of these suggestions would represent a "solution" to your problem, but these would be ideas that I would explore. I would be interested in hearing how you resolve this.

Creating gif image from binary data

I have an image that was given to me in ASCII character format (from an XML document, i,e. sdlf9sdf09e93jr), and I was told that I should be able to convert that into binary and use that data to view it as a .gif image. I've converted all the ASCII characters into binary, but now I'm stuck and not sure what to do from there.
EDIT: Discovered the real problem I'm having: Even though I've translated the ASCII to binary, I've only written it to a file as what the binary should be for those ASCII characters. The "binary" characters are just a bunch of 0's and 1's in ASCII format. I'm using the C language to write this program that will create gif, but don't know what to do to create a .gif from my original XML parse.
First, you need to know the encoding scheme used to encode the image as a sequence of characters in the XML document.
Are you sure you have ASCII data? It may be if it is base-64 encoded. If it is not base-64 encoded, perhaps you are seeing the Latin-1 characters corresponding to each byte.
But you say you have the byte sequence, the "binary" as you call it. If so, then do as MRAB says and save the bytes to a file, slap a .gif extension on that and open it with any viewer.
But again, make sure you know the encoding. Base-64 is common in XML.
If the binary is a GIF image, then just write it to a file with the extension ".gif".

Resources