How to find out what kind of type a file is?

hi there!
does andbody know if it is possible to find out if a file is a picture?
Example: i have a file, with no extension. How can i know, if this file is a gif or a JPG?
thanx for your help!
jules

Rename it "mypic.gif" or ".jpg" and load it.
Alternatively, dig out documentation on the format of Unix file magic files, and decode # GIF
0       string          GIF8            GIF image data
4 string 7a \b, version 8%s,
4 string 9a \b, version 8%s,
6 leshort >0 %hd x
8 leshort >0 %hd,#>10    byte            &0x80           color mapped,
#>10    byte&0x07       =0x00           2 colors
#>10    byte&0x07       =0x01           4 colors
#>10    byte&0x07       =0x02           8 colors
#>10    byte&0x07       =0x03           16 colors
#>10    byte&0x07       =0x04           32 colors
#>10    byte&0x07       =0x05           64 colors
#>10    byte&0x07       =0x06           128 colors
#>10    byte&0x07       =0x07           256 colorsand #------------------------------------------------------------------------------
# JPEG images
# SunOS 5.5.1 had
#       0       string          \377\330\377\340        JPEG file
#       0       string          \377\330\377\356        JPG file
# both of which turn into "JPEG image data" here.
0       beshort         0xffd8          JPEG image data
6 string JFIF \b, JFIF standard
6 string Exif \b, EXIF standard# The following added by Erik Rossen <[email protected]> 1999-09-06
# in a vain attempt to add image size reporting for JFIF.  Note that these
# tests are not fool-proof since some perfectly valid JPEGs are currently
# impossible to specify in magic(4) format.
# First, a little JFIF version info:
11 byte x \b %d.
12 byte x \b%02d# Next, the resolution or aspect ratio of the image:
13 byte 0 \b, aspect ratio
13 byte 1 \b, resolution (DPI)
13 byte 2 \b, resolution (DPCM)#>4     beshort         x               \b, segment length %d
# Next, show thumbnail info, if it exists:
18 byte !0 \b, thumbnail %dx
19 byte x \b%d
# Here things get sticky.  We can do ONE MORE marker segment with
# indirect addressing, and that's all.  It would be great if we could
# do pointer arithemetic like in an assembler language.  Christos?
# And if there was some sort of looping construct to do searches, plus a few
# named accumulators, it would be even more effective...
# At least we can show a comment if no other segments got inserted before:
(4.S+5) byte 0xFE
(4.S+8) string >\0 \b, "%s"
#>(4.S+5)       byte            0xFE            \b, comment
#>>(4.S+6)      beshort         x               \b length=%d
#>>(4.S+8)      string          >\0             \b, "%s"
# Or, we can show the encoding type (I've included only the three most common)
# and image dimensions if we are lucky and the SOFn (image segment) is here:
(4.S+5) byte 0xC0 \b, baseline
(4.S+6) byte x \b, precision %d
(4.S+7) beshort x \b, %dx
(4.S+9) beshort x \b%d(4.S+5) byte 0xC1 \b, extended sequential
(4.S+6) byte x \b, precision %d
(4.S+7) beshort x \b, %dx
(4.S+9) beshort x \b%d(4.S+5) byte 0xC2 \b, progressive
(4.S+6) byte x \b, precision %d
(4.S+7) beshort x \b, %dx
(4.S+9) beshort x \b%d
# I've commented-out quantisation table reporting.  I doubt anyone cares yet.
#>(4.S+5)       byte            0xDB            \b, quantisation table
#>>(4.S+6)      beshort         x               \b length=%d
14 beshort x \b, %d x
16 beshort x \b %d

Similar Messages

  • How to find out what program is using a file I am trying to delete?

    I know I could probably just reboot and then empty my trash without getting this error- but this is a good chance to learn. So, I have a video file I converted with Handbrake. I deleted the file- but it won't let me delete it- saying it is in use (this is even after closing Handbrake). I have closed everything but it still gives me this error. Is there a way to see what program is grabbing it- a terminal command maybe?
    thx

    Open terminal, copy and paste the following
    lsof
    note- trailing blank space,
    drag and drop your file from trash or from desktop to the open terminal window, and return.
    example +lsof /pathtofile+

  • HT2498 how do I find out what kind of fire wire port I have on my desktop? I want to transfer video from my camcorder.

    how do I find out what kind of fire wire port I have on my desktop? I want to transfer video from my camcorder.

    If you have Firewire 800 it's a boxy looking port, the Firewire 400 is thinner and has a arrow looking shape, you can get a adpater.
    FW800 is simply FW 400 x 2, so the adapter gives you FW 400.

  • How can I find out what kind of battery my computer uses in order to buy a replacement?

    I purchased a new Macbook Pro 13" in January 2012. Unfortunately, I did not purchase Apple Care. My trackpad seems to have taken on a life of it's own. I'm guessing this is due to a swollen battery. How can I find out what kind of battery my computer uses in order to buy a replacement?

    Take a look at this link, http://store.apple.com/us/search/macbook-pro-battery-replacement?mco=Nzc1MjMwNg
    This is the MacBook Pro repair answers, http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=Macn otebooks

  • How to find out what user locked account

    We had production type schema account locked this morning. I checked profile which this user belongs and it has 3 times for Failed Login Attempts. My question is how to find out what user had 3 unsuccessful login attempts and lock this account.
    Oracle version 8.1.7

    Assuming that [auditing was enabled|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/security.htm#sthref2916], the command
    AUDIT CONNECT WHENEVER NOT SUCCESSFULThat will write audit records when there is an unsuccessful login. Depending on how you've configured auditing, those records will either be written to the SYS.AUD$ table, in which case you can query them through a few different views, or to a file on the operating system that you can grep.
    Justin

  • "Web'n'Walk III" Huawei dongle, how to find out what Huawei model it is?

    I just bought this "web 'n' walk III" UMTS Modem (USB) made by Huawei. I want to instal it but do not know if the enclosed software is out of date (MobileConnectDriver(2.9.2)) and works under SL. Does anybody know how I find out what type of Huawei dangle it is so I can find the correct software?
    any tips as to how to use this smoothly as the stick is to SIM locked and I will use it with a SIM from an other provider (Stick is branded by T-Mobile).

    I worked out the model number, it is 'hidden' in small print on the back, in a larger number.

  • How to find out what is the lock key for the computer

    How to find out what is the lock key for the computer?

    You don't.
    If you forgot or lost the password, all you can practically do is reset it.
    The manner in which you do so depends on what version of OS X you are running. The older versions utilize the reset password utility on your recovery/re-installation disk/drive.
    On Lion, you use the following technique to reset the Administrators password:
    Boot to your Lion Recovery Partition, by holding down the Option key while starting, and then selecting the Recovery HD as the boot choice.
    Once booted, at the top of the screen is a menu ..., select Utilities / Terminal from the menu bar.
    In the Terminal window, type “resetpassword” (without the quotes) and press return. A “Reset Password” window will open. Select your boot volume (your SSD drive) if it is not already selected. Select your administrators username from the menu labeled “Select the user account” if it is not already selected. Follow the prompts to reset the password. Restart the computer from the apple menu.

  • How to find out what are all the change pointers assoicated for an idoc ??

    Hi ,
    How to find out what are all the change pointers activated for an idoc ??
    Thanks,
    Varma

    Verma,
    You can check what are the active Change Pointers for the message type in tcode <b>BD50</b>
    Use tcode <b>BD61</b> to check whether change pointers are active or not??
    Hope this helps..

  • How to find out what the geniric short forms stand for?

    Hi if you see the ThreadLocal class in jdk1.6 it is written like this in doc. ThreadLocal<T> and if you see the method Class.forName() the return type is Class<?> i am just confused a littele bit. how to find out what this <T> and <?> stands for? I mean how do i know that what to pass in their place?

    [Start from Here|http://java.sun.com/docs/books/tutorial/extra/generics/index.html]

  • How to find out what has been restored to a database instance?

    I'm using RMAN to back up and restore/recover. How to find out what has been restored/recovered to a database instance?
    Oracle version is 11gR2 but compatibility is set to 10.
    Edited by: 881656 on Aug 28, 2012 1:54 AM

    select output
    from V$rman_output
    order by stamp;
    select *
    from V$rman_status
    order by start_time desc;
    Regards
    Asif Kabir
    Handle:      881656
    Status Level:      Newbie
    Registered:      Aug 25, 2011
    Total Posts:      52
    Total Questions:      *30 (30 unresolved)*
    -- please close all the answered threads and mark your helpful post as correct/helpful

  • How to find out what generation my Classic is ?

    Can anyone advise me how I find out what generation my iPod Classic is ? Is there a website I can check with ?
    Many thanks,
    Shell

    Hi Niel, the article I get directed to, doesn't really explain the difference between 6th and 7th generation Classics. Is there anywhere (maybe on the Apple website) I can input the Serial Number and Part Number to be exact ?

  • How to find out what Oracle version?

    Hi,
    Could anyone tell me how to find out what Oracle version is on your AIX/Unix machine? It looks like Oracle Installer doesn't use the native OS installation(installp,pkgadd) process, so I can't use lslpp/pkginfo to find out what filesets are installed.
    Thanks
    HQ.

    Hi!
    As far ar Oracle version is concerned, you can find it at the database level after connecting to the database
    select * from v$version;
    i am not sure if there is someway to find at the o/s level.
    Good luck
    null

  • How to find out what option you got

    How to find out what option you got because i changed my option from option 1 to option 3 and they said that it will change 31st and i want to find out if it changed how do i do that?

    Log on to bt.yahoo.com, and look under the "My Account" section. It tells you what package you're on.

  • How to find out what network an iphone is locked to.

    How to find out what network an iphone is locked to.
    Assist.

    The previous owner/seller didn't provide this info?
    What does it say at Settings > General > About > Carrier?

  • How to find out what version of iTune and iPhoto I have?

    How to find out what version of iTune and iPhoto I have?

    For each application, launch it and choose About from that application's menu, or control-click its Dock icon, choose Show in Finder, control-click that, and choose Get Info.
    (76257)

Maybe you are looking for

  • PL/SQL-Error: ORA-00604 - ORA-01422 makes no sense. Any Idea anyone ?

    Problem: No matter if creating new or recompiling old procedures (that had been compiled successfully lon ago), I always receive the very same error message: ORA-00604: ...recursive SQL level 1 ORA-01422: exact fetch returns more than requested numbe

  • Sending text Attachment using UTL_SMTP

    Hi, I am using UTL_SMTP package for sending a text file thru' a mail. Our database is in a unix machine. My file is created in a folder oracle/DEV/CCare/Data which is in the root directory. In the URL argument of the procedure,which is a varchar2 typ

  • Posting Customer Document.

    Hi, When we post the document using FB01, i am getting an error message stating. FIELD BSEG-MWSKZ does not exist in the screen SAPMF050301. It's regarding tax code.. Please help me in rectifying this error.. and let us knowwhy we are getting this err

  • Headphone Jack Not Recognizing Devices

    Just stepped up from an old G4 iMac 17" to an slightly newer intel iMac 17" and I'm missing my old clear plastic "ball" speakers. There is a different type of jack on these than the 1/8" input on my new (older) iMac so I can't use them. The built in

  • Costing in cProjects

    Hi, I have defined the project role type and asigned cost to it.Later i hav assigned the resource to that role type. I am not able to view the cost for Proj Role type in costing tab and getting an errot that cost/revenue rate is not defined forOrg 00