Gerard Samuel <[EMAIL PROTECTED]> wrote: > Jason Wong wrote: > > >In a response to your previous posts on this matter, I suggested that you > >search freshmeat/sourceforge for a PHP-based media file metadata extractor > >(yes one does exist). I'm putting forward the same suggestion again. > > > > > Ok, Ill look, but not sure what good it will do me, as Im already > reading a file's metadata (using my own code). > Im basing my assumption, on that binary data may share so called "magic" > bytes. > Like an mpeg header (11111111111) may/or may not appear in other file > formats. (Purely an assumption as of this moment) > But thanks for reminding me on the other code...
I hope your not using that 11111111111, that isn't correct for an mpeg file. I would also point out that even if the magic was unique and you could tell that the file was the type it is suppose to be, the person can still put invalid data inside there. Like wrap a jpeg header and eof marker in there but have an executible within it. Some file formats have crc's built in, like mp3. You could also run a crc check on the files if its available. I believe avi's do to, but i'm sure since this isn't reliable it isn't going to be a reasonable solution. Another thing to do to garuantee the file would be to decode the format and then reencode it ie(mpeg, mp3, jpeg, gif, etc). then again this seems like overkill and plus with lossy formats like mp3 and jpeg you'll lose quality. I'm not sure if this is a big issue for you, I just thought I'd point that out. any way, thats just a few comments i had on that Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php