Extract embedded resources
Hi I’m new to Qt and have been trying it out with simple apps. I compiled some jpegs in to an EXE file, which I now need to extract as the original images are lost due to a hard disk crash. Is there a Qt utility which would help me do that?
Many thanks.
9 replies
If you need utility to extract images, you can try Restorator 2007.
If you need sample how to do that in Qt, look here [developer.qt.nokia.com]
Who has told where is an example using Restorator on that page? O_oWell, if my understanding of the English language is correct (I am not a native speaker, so I might be off), the highlighted ‘that’ in the second sentence of the quote below refers to the ‘extracting of images’ from the first sentence.
If you need utility to extract images, you can try Restorator 2007. If you need sample how to do that in Qt, look here [developer.qt.nokia.com]
Hence, in my understanding, you wrote that there would be an example of extracting images behind the link. Otherwise, what does ‘that’ refer to exactly?
Thanks for all who are contributing to this topic. Unfortunately I haven’t had any joy with any of the suggestions. I have now gone down the route of using a hex editor to edit the EXE file and extract the required jpeg sections by identifying the start and end markers FFD8 and FFD9 respectively of an embedded jpeg. However the resulting jpeg file is being reported as corrupt and am unable to open it using many different graphics applications. I guess the reason for that is because the header information which should identify the file as jpeg i.e. JFIF is either missing or was converted at compile time to something which is specific to Qt environment only.
Good header: FF D8 FF E0 00 10 4A 46 49 46 00 01 00 01 01 2C where 4A 46 49 46 corresponds to JFIF.
Not-so-good header (from my EXE file): FF D8 70 79 09 59 26 2A 60 46 AC F7 00 as you can see the 4 bytes (4A 46 49 46) corresponding to JFIF in the good header is missing here.
Does anyone know if Qt manipulates jpeg headers before embedding them in to EXE files?
The files are stored “as is”. qrc does not manipulate the contents. While stand alone qrc files (to be loaded after application startup) can be compressed, the compiled in resources are one to one copies of the bytes of the files on the disk. For qrc it’s only files, it is not aware of the concept of images or the like.
You must log in to post a reply. Not a member yet? Register here!



