hisoka Posted January 7, 2016 Share Posted January 7, 2016 I have a png image in which there this block zTXtEmail..xÚ.GÌÌ+Ñós.Q(7Ö25..'„.r×eµé....IEND®B`‚ I know that in the zTXt there is a text according to this : A zTXt chunk contains: Keyword 1-79 bytes (character string) Null separator 1 byte (null character) Compression method 1 byte Compressed text datastream n bytes Keyword = Email Null separator is = 00 Compression method is 00 and from x = 78 in hexadecimal until IEND the end of the file it is the text data stream : xÚ.GÌÌ+Ñós.Q(7Ö25..'„.r×eµé.... So I would like to decode the above text data stream to make it readable but I am unable to do it . Please help Link to comment Share on other sites More sharing options...
Ingolme Posted January 8, 2016 Share Posted January 8, 2016 You need two things: 1. The specification which indicates which compression algorithm 0 refers to 2. A program that will run that algorithm on the string. Since the string probably contains some non-printable characters, what you've posted on the forum probably won't work, you need to get the specific bytes from the file and pass them through the decompression algorithm. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 8, 2016 Share Posted January 8, 2016 You can use something like a hex editor to figure out the actual bytes that are there. Some text editors may have problems dealing with null bytes and things like that. Link to comment Share on other sites More sharing options...
hisoka Posted January 11, 2016 Author Share Posted January 11, 2016 ok after some researches ; I found that the ZLIB library decompresses the data above . So I downloaded the version 1.2.8 from this site : http://zlib.net/ zlib source code, version 1.2.8, tar.gz format (558K, MD5 checksum 44d667c142d7cda120332623eab69f40): then I read some articles on how to use it : like this : http://www.zlib.net/zlib_how.html http://www.experts-exchange.com/articles/3189/In-Memory-Compression-and-Decompression-Using-ZLIB.html https://bobobobo.wordpress.com/2008/02/23/how-to-use-zlib/ and some others but I am more confused and stuck then before as it seems that some programming skills are involved in C and C++ and it is not a normal software . I have the zlib 1.2.8 installed in my pc (with windows xp) but I do not know how to use it even after reading many articles and the documentation that comes installed with zlib . Could you please provide me step by step on how to use the zlib file installed in my pc to decompress the datastream above in my png photo . As a newbie I am really stuck and cannot find my way best regards and happy new year for both you justsomeguy and Foxy Mod Link to comment Share on other sites More sharing options...
justsomeguy Posted January 11, 2016 Share Posted January 11, 2016 Zlib is a compression library, you use it to write a C/C++ program that supports zlib compression. If you want to read the metadata from a PNG file, then find a program specifically for that, there are several available. ImageMagick is one program that will display PNG metadata. Link to comment Share on other sites More sharing options...
hisoka Posted January 12, 2016 Author Share Posted January 12, 2016 I want to be able to make the text datastream in the zTXt chunk of a png readable . does ImageMagick decompress the compressed text in the zTXt chunk of a png and make it readable for me ? if not , which uncomplicated software , justsomeguy, do you suggest me to use to make the text under zTXt chunk readable if we take in consideration that the compression method is inflate/deflate compression in zlib format according to this : http://www.w3.org/TR/PNG-Compression.html ?? Link to comment Share on other sites More sharing options...
hisoka Posted January 12, 2016 Author Share Posted January 12, 2016 ok I used ImageMagick as you told me and tried to read the metadata : this is a sample : Background color: srgba(254,254,254,1)Border color: srgba(223,223,223,1)Matte color: grey74Transparent color: noneInterlace: NoneIntensity: UndefinedCompose: OverPage geometry: 644x445+0+0Dispose: UndefinedIterations: 0Compression: ZipOrientation: UndefinedProperties: date:create: 2015-12-30T00:19:33+01:00 date:modify: 2015-12-30T00:19:34+01:00 So the compression used is ZIP . The problem is that I do not know how to decompress a png compressed using zip compression . Justsomeguy could you help me please . Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted January 12, 2016 Share Posted January 12, 2016 If you're an end-user then you find a piece of software for viewing PNG metadata that will show everything, including custom metadata. https://www.google.com/search?client=opera&q=view+png+metadata&sourceid=opera&ie=UTF-8&oe=UTF-8 If you're a programmer and you want to write a program to do that, then that is where you need to use things like zlib and the PNG specification to write the code to extract all of that information. Link to comment Share on other sites More sharing options...
hisoka Posted January 12, 2016 Author Share Posted January 12, 2016 (edited) I would like to know how to decompress a png image and not to view its metadata what is the name of the software which I can use to decompress a png image that is compressed using zip compression? I could not find helpful resources in google Edited January 12, 2016 by hisoka Link to comment Share on other sites More sharing options...
justsomeguy Posted January 12, 2016 Share Posted January 12, 2016 If someone zipped a PNG image, then you use any unzipping tool (e.g. 7-zip) to unzip the .zip file and get the .png file out of the zip archive. But that's not what you want to do, is it? Instead you print out the metadata, see "zip" listed for the compression, and think that you can somehow "unzip" the PNG image. What exactly do you expect to see once you do that? The image data is compressed to make the file smaller, if you remove the compression you'll most likely end up with a string of binary digits (or whatever the PNG specification says about the raw data). So, what's the point? What specifically are you trying to do? If you're trying to read the zTXt data, that's metadata. If that's not what you're trying to do, what are you trying to do? Is this some steganography question? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now