Crowz's Profile User Rating: -----

Reputation: 3 Apprentice
Active Members
Active Posts:
68 (0.07 per day)
09-February 12
Profile Views:
Last Active:
User is offline Mar 16 2013 08:47 AM

Previous Fields

Dream Kudos:
Icon   Crowz has not set their status

Posts I've Made

  1. In Topic: how to flip image vertically

    Posted 8 Nov 2012

    You could use the kernel library and convert your image to a 2dimensional array then do some matrix math on it.
  2. In Topic: Finding the type of a file

    Posted 3 Nov 2012

    Is there a way one could find the size of a header?
  3. In Topic: Finding the type of a file

    Posted 3 Nov 2012

    View Postjimblumberg, on 03 November 2012 - 09:24 AM, said:

    If you read the first two bytes of the file and they don't contain 0x4D and 0x42 you will know that this file is not a BMP file. However if the first two bytes are 0x4D and 0x42 you can not positively determine that this file is a BMP file. Even if you were to read the entire 54 byte header and the contents match the description of the header you can only assume that this is a BMP file but you still can't be 100% certain.


    Ah, I see. How would you recommend finding the file type? I want to basically get down to raw data to perform operations on the picture itself, then once it is finished, save it again as the same file type.
  4. In Topic: Finding the type of a file

    Posted 3 Nov 2012

    View Postjimblumberg, on 03 November 2012 - 09:09 AM, said:


    Essentially what I am attempting to do is extract the first two bytes in order to compare it to known signatures, such as PNG (89 50 4E 47 0D 0A 1A 0A). I will make an if else statement that looks for all known signatures of picture files, if it's not a picture file, exit the program.
    How, exactly, would I go about doing that?

    You would probably want to start by opening the file in binary mode. Second you also need to realize that just reading the first two bytes will not definitely tell you what kind of file you are dealing with. Also this: (89 50 4E 47 0D 0A 1A 0A) is 8 bytes not 2 bytes.


    Let's say I am doing BMP then, and want to check if the file is definitely BMP
    The signature seems to be 2 bytes. Can I read X amount of bytes from an offset in a file? On that note, could I cut off the header and save it, in order to add it back on later while I do raw manipulation of data?

My Information

Member Title:
D.I.C Head
Age Unknown
Birthday Unknown

Contact Information



Crowz hasn't added any friends yet.


Crowz has no profile comments yet. Why not say hello?