Page 1 of 1
Reading grfId from grf (PHP)
Posted: 23 Aug 2005 11:26
by Dinges
As a new feature for my graphics site I would like to extract grfID's from grf files. Is there an exact location within the GRF file where I could find this ID? It is mainly for building a GRFid database, and to check if the GRF file uploaded is valid.

Posted: 23 Aug 2005 11:45
by peter1138
The location is not fixed in the file. You will have to parse it for the Action 8 which means understanding bits of
http://wiki.ttdpatch.net/tiki-index.php ... phicsSpecs
Posted: 23 Aug 2005 11:54
by Dinges
I do not mean the NFO file, the encoded GRF file.
Posted: 23 Aug 2005 11:56
by peter1138
What do you think happens to the NFO file?
Posted: 23 Aug 2005 12:37
by Dinges
dunnow, please tell me...
Posted: 23 Aug 2005 12:41
by Hyronymus
But why don't you force submitters to add the GRFID? Can't you make GRFID a required description field on the submit form?
Posted: 23 Aug 2005 12:48
by peter1138
Look at a GRF file with a binary editor. Compare with an NFO file. See how the numbers are the same, albeit with a few extra bytes...?
Re: Reading grfId from grf (PHP)
Posted: 23 Aug 2005 13:03
by Purno
Hyronymus wrote:Can't you make GRFID a required description field on the submit form?
guess not:
Dinges wrote:and to check if the GRF file uploaded is valid.
Posted: 23 Aug 2005 13:19
by eis_os
Should be quite easy with fread, fopen. Didn't take long to have it in TTShellExt (c++) ... (The conversation to unicode and OLE String is more work in TTShellExt)