converting ASCII text to jpg image - hex

I am trying to convert an ascii text to a jpg image. When I use the unix file myFile.jpg command, it givesmyFile.jpg: ASCII text, with very long lines.
I have tried to use online text to jpg converters but to no avail. I am pretty sure the flag is of jpg format because it starts with ffd8 and ends with ffd9.
The ascii hex of the image starts like ff d8 ff e0 00 ....
I tried to use the online converters but it didn't work. I'm not sure how I could do this ?

I was looking for the same thing, but no success. What I did was to copy the ASCII text/art into an text area in Photoshop (should of course work with any other tool like Photoshop). Then changed the font to Consolas. After that I could save the result as an image file.

Related

How to insert RAW Hex data from a text file?

I'm using Hex Workshop and I needed to edit numerous data so I selected a range of HEX values and copied it to Notepad++.
I edited the values and now I need to copy it back to HEX Workshop but it seems to be a little problem. When I just CTR+C, I can't paste in HEX Workshop.
I tried using the Insert function but it will just convert everything from the TXT file to HEX. That's not what I want - the content on TXt file is already in HEX. I just want to simply paste and overwrite the values in HEX Workshop.
Same as I would if I edited it manually byte by byte in HEX editor but I just want to copy these values form TXT and paste it in HEX.
I know I can edit in HEX editor ofc, but I needed to do some other stuff around these HEX values.
I use the open source tool Be.HexEditor for pasting text hex values into a file as hex:
Copy hex code to the clipboard
Open target file to insert hex code
Move the cursor to the the desired position to insert hex
Click Edit > Paste Hex
Save
Nevermind. Hex Editor Neo did the trick.

Where is the value in HEX for the file size in a jpg (exif)

I can carve out images no problem, but I remember a long time ago being shown where to find the file length of a jpg (in bytes) so that if i had issue with an auto recovery i can do it manually.
where in a jpg exif header in HEX are the values (which i know needs converting into little endian?) that tell me the size of the file, so i can scroll to the end of the file, find FF d9 and recover the image.
Can anyone point me to where those HEX values are in these types of JPG's?
Thank you!

convert unix executable file to plain text

I see many people convert text to unix file. Is there some way to do the opposite, unix executable file to .txt?
(I need to read unix executable files under mac os. If it is impossible to convert the file, is there a way I can read them? UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 468: invalid start byte
)
I have noticed that nano seems to convert to text automatically, although I want to be able to view it in a text editor, so I am still trying to find another way.
If you are trying to read the file in Python, you need to append 'b' to the mode in order to avoid newline replacement.

Hex code lose his format

Can somebody say me what is the problem:
I will print out a hex file on the "Epson TM-t88II" printer, but after this all my "Umlaute" (ä/ö/ü/ß) lost its format and are black dots, etc.
My Hex code for an ü is "FC". Is it false?
&00FC is "ü" in many encoding formats, but not all. If your printer does not know what encoding you're using, it may well not understand what you want to print.
Exactly what are you sending to the printer? And what application are you printing from?
The following may also be of interest.
http://www.joelonsoftware.com/articles/Unicode.html

How can I convert MathType equation into MathML format?

I want to convert MathType equation saved as GIF format to MathML. Firstly, I opened these GIF files and saved them within MathType 6.7. As a result, MathML text is inserted into the end of GIF files. However, when I extracted MathML text from these GIF files using Perl script, I found some garbled characters in the MathML text as following text:
<mn>xxx</mn>
In the above line, a garbled character  is inserted before 'mn' label. Is this MathType 's BUG? How can I work around this problem? I have uploaded my test GIF files. URL is: http://ubuntuone.com/p/1352/
Update:
I have tried to paste full block of MathML here, but I found the syntax format of MathML text was messed. So I pasted the MathML on GitHub: https://gist.github.com/1068723.
There is a garbled character in the seventh line of MathML text: "  ?#x00A0;".
The original GIF file which doesn't contain MathML text: http://ubuntuone.com/p/13Ba/
Perl script that extracts MathML from GIF image generated by MathType: https://gist.github.com/1068749
Thanks,
thinkhy
Thanks thinkhy. It could be you extracting the data incorrectly (we haven't looked at your script yet). Only one of your GIFs had MathML -- the one that has a file name starting 106R. In that one, if you just grab all the bytes from the first bit that looks like MathML until the end, you do periodically get odd bytes in there, mostly 255's except the last one. (This however doesn't appear to be the junk character you're seeing.) The reason for the 255's is that the MathML is distributed over multiple comment records, each one of which starts with a count of the bytes in the record. From the MathType SDK (free download; link below):
GIF Image Files
MathML text is embedded into a GIF file as an Application Extension Record, which consists of a 14-byte header (Application Extension Descriptor), followed by the MTEF data. The header contains:
Byte Introducer = 0x21;
Byte ExtensionLabel = 0xFF;
Byte BlockSize = 0x0B;
Byte ApplicationId[8] = "MathType";
Byte AuthenticationCode[3] = "003";
The data follows this header and is written as a series of blocks each containing 255 bytes or less. Each block starts with a single byte count followed by the data. The end is marked as a block with length 0.
The header is unique enough that the easiest way to extract the data might be to scan the file for the 14-byte header, then expect the MathML data blocks to follow. Properly decoding the GIF records isn't that hard either, but obviously requires you read the GIF specification.
You may already be using the SDK, but you didn't say whether you were or not, so here's the link: http://www.dessci.com/en/reference/sdk/.

Resources