Reading metadata of a JPEG image

Hi,
I am trying to read the metadata of an image taken from mobile.
how can i extract the thumbnail from the metadata?
I will be receiving the image as bytearray from client.
Thanks & Regards,
Sairam

http://www.drewnoakes.com/code/exif/

Similar Messages

  • Synchronizing IPTC/IIM and XMP metadata in JPEG images

    Excerpt of "IPTC Core Implementation Guidelines", section 2.2.1 available on http://www.iptc.org/IPTC4XMP/:
    The basic functionality of this synchronising mechanism [between IPTC/IIM metadata in IRB and XMP metadata] is:
    - To move metadata from the IRB to a new XMP packet in case an image file is opened with such an IRB but without an XMP packet. If the file is saved both the IRB and the XMP packet will be stored to the header section of this file.
    - To move metadata from the XMP packet to a new IRB in case an image file is opened with an XMP packet but without an IRB. If the file is saved both the IRB and the XMP packet will be stored to the header section of this file.
    - To update the metadata values of the IRB respectively the XMP packet from the newer source to the older destination. Which set is newer or older is detected by a hash value over each block of metadata. (More detailed information is available from Adobes XMP web pages at www.adobe.com/xmp and in the software development kits.)
    I have checked for Adobe XMP web site and searched in "XMP Specification, January 2004" and I have not found explanations about this "hash value over each block of metadata" mechanism.
    Moreover, it seems that it does not work regarding to the following simple experiment:
    - 1. add metadata to a JPEG image using Photoshop CS (which adds both IPTC/IIM data in IRB and data in XMP)
    - 2. edit these metadata using an "IPTC/IIM-only and non-XMP-aware" editor like IrfanView, XNView or any other one
    - 3. go back to Photoshop CS which displays the "old" XMP metadata ignoring changes done previously using the IPTC-only editor.
    Of course this experiment works using an "XMP-aware" editor like iView Media Pro or PixVue in step 2.
    So it seems very easy to get images with IPTC/IIM and XMP metadata not synchronized when the image workflow uses different programs to edit metadata.
    Am I missing or misunderstanding something ?
    I have found a radical method stripping XMP metadata (in a step 2 bis...) using David Crowell's JStrip, see
    http://davidcrowell.com/jStrip.aspx
    Do you know any other best method to keep IPTC/IIM and XPM data synchronized when an image workflow uses different metadata editors and some of them are not XMP-aware ?
    Patrick Peccatte
    www.softexperience.com

    Excerpt of "IPTC Core Implementation Guidelines", section 2.2.1 available on http://www.iptc.org/IPTC4XMP/:
    The basic functionality of this synchronising mechanism [between IPTC/IIM metadata in IRB and XMP metadata] is:
    - To move metadata from the IRB to a new XMP packet in case an image file is opened with such an IRB but without an XMP packet. If the file is saved both the IRB and the XMP packet will be stored to the header section of this file.
    - To move metadata from the XMP packet to a new IRB in case an image file is opened with an XMP packet but without an IRB. If the file is saved both the IRB and the XMP packet will be stored to the header section of this file.
    - To update the metadata values of the IRB respectively the XMP packet from the newer source to the older destination. Which set is newer or older is detected by a hash value over each block of metadata. (More detailed information is available from Adobes XMP web pages at www.adobe.com/xmp and in the software development kits.)
    I have checked for Adobe XMP web site and searched in "XMP Specification, January 2004" and I have not found explanations about this "hash value over each block of metadata" mechanism.
    Moreover, it seems that it does not work regarding to the following simple experiment:
    - 1. add metadata to a JPEG image using Photoshop CS (which adds both IPTC/IIM data in IRB and data in XMP)
    - 2. edit these metadata using an "IPTC/IIM-only and non-XMP-aware" editor like IrfanView, XNView or any other one
    - 3. go back to Photoshop CS which displays the "old" XMP metadata ignoring changes done previously using the IPTC-only editor.
    Of course this experiment works using an "XMP-aware" editor like iView Media Pro or PixVue in step 2.
    So it seems very easy to get images with IPTC/IIM and XMP metadata not synchronized when the image workflow uses different programs to edit metadata.
    Am I missing or misunderstanding something ?
    I have found a radical method stripping XMP metadata (in a step 2 bis...) using David Crowell's JStrip, see
    http://davidcrowell.com/jStrip.aspx
    Do you know any other best method to keep IPTC/IIM and XPM data synchronized when an image workflow uses different metadata editors and some of them are not XMP-aware ?
    Patrick Peccatte
    www.softexperience.com

  • Reading metadata with exiftool

    OK, let's bounce this one around and see if anyone has an elegant solution!
    I'd like to read metadata that is in images/sidecars, but which LR doesn't display, and put the information into custom fields. While it would be great to have direct access - ie the SDK should let you read XMP data from files or from the Additional_metadata SQL table - in in its absence I am using Exiftool to extract that information. Where I hit a roadblock is that LRTasks can send the correct command line, but LRTasks.execute only returns a 0 or 1, the OS exit message, and not the Exiftool string.
    So I'm forced to look at alternatives. One would be to make Exiftool generate a temporary file, and then attempt to read that. Any other ideas - or support for the above feature request ?
    John

    Hmmm, I responded via email 8 hours ago yet it hasn't shown up. This response might be duplicated if there's just a big latency:
    John - Yes, it's frustrating knowing how much powerful functionality is sitting there but not accessible to us. I hope the SDK opens up much more in upcoming versions.
    Let me know when/if you proceed with this particular idea. I have a project I'm going to need this for in about a month or so and it'd be nice to not reinvent the wheel. If you won't need it until after that, I'll get it going and then we can compare notes when you're ready. Plus, I'm on Windows and would need a Mac user to verify things are working - I assume you'll need the reverse (?).
    db

  • How to read XMP metadata from a Jpeg

    This seems like it should be a no-brainer, but I can't find any classes to do this ?? I can find classes to read song titles from MP3 files, I want to do similar with jpeg image files.
    In photoshop and lightroom you can set up titles and captions (and copyright info) in the metadata. When you save a jpeg this gets embedded in the file.
    How to read this info and parse it and use it once you have loaded it into a BitMapData???
    I am Flash/AS3.0 code only no IDE -  please no flex/AIR examples!
    Thanks!

    http://www.adobe.com/devnet/xmp/

  • Save metadata in LR - degrade JPEG image quality?

    Hi:
    Does anyone know whether using the 'save metadata' feature in LR to save changed metadata to a JPEG file will result in a resaving of the entire file and/or otherwise degrade the JPEG image quality? 
    If it does not degrade the image quality, how does this feature work?
    Many thanks for the help

    Each pixel remains unchanged in this process.
    I was under the impression that any re-saving of a jpeg image results in a slight loss of quality, regardless of whether there have been changes to the image
    This is true for other editors, such as Photoshop or Photoshop Elements, but it is not true for Lightroom because, as explained, LR does things differently than other software.

  • Read metadata of jpeg

    hi guys:
    I have a problem about using ImageReader.reader.getImageMetadata to fetch metadata from a jpeg file . Unfortunately, i got such error
    Exception in thread "main" javax.imageio.IIOException: ICC APP2 encountered without prior JFIF!
    It seems like a bug of java . How could I resolve it?
    Besides that, I have another question. Could we get one or two specific metadata from a jpeg file without load whole file into the memory. For example, I only want the location information in a photo which are took by my iphone.
    Please help me . I'm not a image handling expert.
    Thanks.

    Some points should help.
    1. There are two types of meta data available from after reading, or before writing with an image.
    a. stream meta data
    b. Image meta data
    2. you need to read the image completely first with the java.imageio.ImageReader of which you can choose to read only image-index number "0" (that is the main image) . ( and generally there are no extra index of images - "no thumbnails").
    3. You can obtain the Image meta data better from the returned IIOImage object, but finally you will need to be good at making iteration loops to use the getTree() method to obtain the XML "org.w3c.dom.Node" that contais the meta data, that has been formatted by the java API.
    4. About the "JFIF" name in .jpeg and .jpg streams , it does not like that "format name" on the stream and throws an error , i haven't used the newer JAI classes at this time that use Tiff format and JPEG 2000 format.
    Only .tiff .jpeg .jpg extensions in java can have EXIF data , "stream data is independent of" EXIF and GPS info, and is with the image type/format spec.
    note .jfif is an extension sometimes found on jpeg and jpg types and heavily realted compressor specs that carry non stream meta data.
    Edited by: 893871 on 30/10/2011 11:34
    Edited by: EJP on 31/10/2011 09:25: thanks for your answer although you're a year late. Removed your question which should be asked in a new thread. Nobody will see it here and in any case reviving old threads with new questions is considered bad form. Locking this thread.

  • Error when exporting to pdf - cannot read a jpeg image, but I do not know which jpeg image.

    I have created a document (A5) in Indesign cs6 with 116 pages. Because I would like to print the book I want to export it to pdf. Normally this is no problem for me, but now I got the following error: "Error encountered while reading JPEG image. Image may be damaged or incompatible. Resave the image with different settings and try again." This is quite annoying as my book contains 631 links of which most are .jpg. Does anyone know how I can find out which picture gives the error?
    What is remarkable is the following. As it is a very large file InDesign automatically splitted it in subsections (with names like 'A5 V' or 'A5 V3'). To get closer to the problem I tried to export each subsection (all between 3 and 30 pages) to pdf. But somehow I managed to do this, so one might think that there is nothing wrong with the document at all. But when I try to expor the document as a whole again I still get this error about the JPEG image. It takes a couple of minutes (somewhere between 30 and 40% of the exporting) before I get the error.
    Is there anything I should have tried which I forgot? I hope anyone can help me with this problem.

    If you are able to export as sections it's almost certainly not actually a problem with the image, but a problem of not enough system resources to finish the job. This is not uncommon with large complex PDF exports.
    Try rebooting, then immediately open ID and try the export again first thing. If it works, great. If  not, you can combine your sections into a single PDF in Acrobat Pro.

  • Reading metadata to - from image files

    I am using Creative Suite CS4.  In CS3 I created two custom XMP metadata pages that I used to add information to RAW, TIF, PSD files.  The resulting custom panel could be seen and used in Bridge and Extensis Portfolio.  In CS4 that all changed.  I can create the GUI part of the panel using Flex Builder 3.
    My questions are 1) How do you get the controls to work (combo boxes with fixed lists, fields for text data and a note field), 2) how do I get the data from the image file, have it update when a field changes, read it back to the image file when closed, and 3) how do I get it to work in Bridge CS4 properly and also be readable to Extensis Portfolio.
    I have attached the CS3 files that were used to create the panels in CS3.
    Fred

    I am using Creative Suite CS4.  In CS3 I created two custom XMP metadata pages that I used to add information to RAW, TIF, PSD files.  The resulting custom panel could be seen and used in Bridge and Extensis Portfolio.  In CS4 that all changed.  I can create the GUI part of the panel using Flex Builder 3.
    My questions are 1) How do you get the controls to work (combo boxes with fixed lists, fields for text data and a note field), 2) how do I get the data from the image file, have it update when a field changes, read it back to the image file when closed, and 3) how do I get it to work in Bridge CS4 properly and also be readable to Extensis Portfolio.
    I have attached the CS3 files that were used to create the panels in CS3.
    Fred

  • JPEG IMAGE READING

    hi
    i want to read an jpeg image, remove the header,uncompress it and accesses its image 2d array how can i do it?

    Why would you want to do that?
    I hope its not to read hidden messages inside a jpeg.
    Mr. usmanmuhammad....................

  • How do I change the JPEG image size in PSE-12 when opening from RAW

    Switching from PSE-9 to PSE-12. When a JPEG image is opened RAW in PSE-12 the size is 18.72" Wide x 12.48" high 300 DPI. The same image in PSE-9 is 23.4" wide x 15.6" High 240 DPI. How do I get PSE-12 to open the image as in PSE-9?

    Uncheck the boxes at the bottom of the dialog Scale styles and resample Image so that only constrain proportions is checked. If you the change the resolution box from 240 to 300 you will get back to your original dimensions.
    This is a meaningless thing to do, you still have the exact same number of pixels, you have only changed the metadata number in the file for ppi, and your prints are not affected by this number.
    You could also use the same method to change the dimensions to 6 x 4 or 9 x 6 etc.
    There are some cases (actually most cases) where you need to CROP the photo to change the dimensions, when the aspect ratio of the original photos is different than the aspect ratio of the final photo; the specific case in 99jon's example is the only case you ever want to change dimensions using Image->Resize->Image Size, where the aspect ratio doesn't change from 6x4 to 9x6 (or 12x8 or 18x12 or ...), and even then, you could do the same thing simply by telling the printer the size you want, you don't really need to do anything in PSE.

  • I cannot erase alias JPeg images on a memory card so that it will not accept any more which I try to load onto it, yet there are no actual images available if I click on any of them. The error message states that one or more cannot

    Cannot delete aliases for JPeg images on a lumix camera memory card even selecting individual images anjd trying to move to trash -error35 one or more items cannot be found. No image available on clicking or if card put back into camera-"no images to disply" Yet if try to add more images, message that card is full! Any suggestions?

    Deleting from iPhoto or image capture after import should be fine and shouldn't cause any issues. Deleting from the folder view of finder, can cause issues as the camera can the image is still there. You can try emptying the trash on your mac if you deleted them via the finder, as although you've deleted it, it's only marked as trashed and not actually deleted until you empty the trash - ie it won't relieve the space taken by the files.
    If your still having issues after you try this, you may be best formating the memory card. This will wipe all data on it though, so make sure you do copy anything off that yo u want to keep! Format from the camera, so that choosing the format>erase all option from the menu of most cameras.

  • Reading grayscale values from saved image

    Hi,
    I've written several methods that crop, convert to grayscale, histogram equalise and then resize a colour jpeg image for preparing sets of images for a face detection neural network. The next thing I want to do is to write a method that allows me to read that saved grayscale images pixel values back as singular grayscale values from the RGB values that were used to save the jpeg. I used this code to create the 2D array of grayscale pixel values
          for (int i = 0; i < imageWidth; i++)
                for (int j=0; j <imageHeight; j++)
                    grayRGB[i][j] = (rgb[i][j] & 0xff000000) | (eqGray[i][j]<<16) | (eqGray[i][j]<<8) | (eqGray[i][j]);
                    img.setRGB(i, j, grayRGB[i][j]);
                }and then used this code to resize the image:
            BufferedImage resized = new BufferedImage(20,20,1);
            Graphics2D g = resized.createGraphics();
            g.drawImage(img, 0, 0, 20, 20, null);
            g.dispose();my class gets the RGB values on instantiation as follows:
            //get RGB pixel values for image loaded
            for (int i = 0; i < imageWidth; i++)
                for (int j=0; j <imageHeight; j++)
                    rgb[i][j]= inputImage.getRGB(i,j);
                    //perform bitwise shift rgb information values to obtain appropriate values for each colour pixel
                    r[i][j]=  (rgb[i][j] >> 16) &0xff;
                    g[i][j]=  (rgb[i][j] >> 8) &0xff;
                    b[i][j]=  (rgb[i][j]) &0xff;
                }Is there a way to get the grayscale values directly from an image that is already converted to grayscale without having to perform the grayscale conversion method again, perhaps using a similar bitwise shift?
    Thanks
    Nick

    answering this myself for those lost souls like i was a while ago:
    the answer is very simple when you get to know it :) : use a signed type for your image. this can be achieved by using the Format Operator (javax.media.jai.operator.FormatDescriptor). an example as follows :
            BufferedImage bufferedImage= someimage...
            ParameterBlock pb = new ParameterBlock();
            pb.addSource(bufferedImage);
            pb.add(DataBuffer.TYPE_SHORT);
            RenderedImage formattedImage =
                    JAI.create("format", pb, null);
    // you may use as well TYPE_DOUBLE or TYPE_FLOATimage could be of any type such as PlanarImage, BufferedImage, RenderedImage etc..
    then all you need to do is read your pixel values by using an iterator such as RectIter or RandomIter to access pixel values etc..
    San

  • I am trying to use photomerge compose.  I open one standard jpeg image and one image that is my business logo in a png format.  When I select the png image, to extract the logo from it, it appears as all white and will not allow me to select the logo from

    I am trying to use photomerge compose.  I open one standard jpeg image and one image that is my business logo in a png format.  When I select the png image, to extract the logo from it, it appears as all white and will not allow me to select the logo from it.  It has worked in the past but I downloaded the update today and photomerge will not work correctly.  Any ideas?

    hedger,
    How do you expect anyone to help when we don't know a darned thing about the file, abut your setup, exact version of Photoshop and your OS, machine specs, etc.?
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • How to insert a pdf or jpeg image into a blob column of a table

    How to insert a pdf or jpeg image into a blob column of a table

    Hi,
    Try This
    Loading an image into a BLOB column and displaying it via OAS
    The steps are as follows:
    Step 1.
    Create a table to store the blobs:
    create table blobs
    ( id varchar2(255),
    blob_col blob
    Step 2.
    Create a logical directory in the database to the physical file system:
    create or replace directory MY_FILES as 'c:\images';
    Step 3.
    Create a procedure to load the blobs from the file system using the logical
    directory. The gif "aria.gif" must exist in c:\images.
    create or replace procedure insert_img as
    f_lob bfile;
    b_lob blob;
    begin
    insert into blobs values ( 'MyGif', empty_blob() )
    return blob_col into b_lob;
    f_lob := bfilename( 'MY_FILES', 'aria.gif' );
    dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
    dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
    dbms_lob.fileclose(f_lob);
    commit;
    end;
    Step 4.
    Create a procedure that is called via Oracle Application Server to display the
    image.
    create or replace procedure get_img as
    vblob blob;
    buffer raw(32000);
    buffer_size integer := 32000;
    offset integer := 1;
    length number;
    begin
    owa_util.mime_header('image/gif');
    select blob_col into vblob from blobs where id = 'MyGif';
    length := dbms_lob.getlength(vblob);
    while offset < length loop
    dbms_lob.read(vblob, buffer_size, offset, buffer);
    htp.prn(utl_raw.cast_to_varchar2(buffer));
    offset := offset + buffer_size;
    end loop;
    exception
    when others then
    htp.p(sqlerrm);
    end;
    Step 5.
    Use the PL/SQL cartridge to call the get_img procedure
    OR
    Create that procedure as a function and invoke it within your PL/SQL code to
    place the images appropriately on your HTML page via the PL/SQL toolkit.
    from a html form
    1. Create an HTML form where the image field will be <input type="file">. You also
    need the file MIME type .
    2. Create a procedure receiving the form parameters. The file field will be a Varchar2
    parameter, because you receive the image path not the image itself.
    3. Insert the image file into table using "Create directory NAME as IMAGE_PATH" and
    then use "Insert into TABLE (consecutive, BLOB_OBJECT, MIME_OBJECT) values (sequence.nextval,
    EMPTY_BLOB(), 'GIF' or 'JPEG') returning BLOB_OBJECT, consecutive into variable_blob,
    variable_consecutive.
    4. Load the file into table using:
    dbms_lob.loadfromfile(variable_blob, variable_file_name, dbms_lob.getlength(variable_file_name));
    dbms_lob.fileclose(variable_file_name);
    commit.
    Regards,
    Simma........

  • Problem while encoding JPEG image from JFrame paintComponent in a servlet

    Hello!
    I m developing webapplication in which I made one servlet that calls JFrame developed by me, and then encoding into JPEG image to send response on client browser. I m working on NetBeans 5.5 and the same code runs well. But my hosting server is Linux and I m getting the following error:
    java.awt.HeadlessException:
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
         java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
         java.awt.Window.<init>(Window.java:406)
         java.awt.Frame.<init>(Frame.java:402)
         java.awt.Frame.<init>(Frame.java:367)
         javax.swing.JFrame.<init>(JFrame.java:163)
         pinkConfigBeans.pinkInfo.pinkModel.pinkChartsLib.PinkChartFrame.<init>(PinkChartFrame.java:36)
         pinkConfigBeans.pinkController.showLastDayRevenueChart.processRequest(showLastDayRevenueChart.java:77)
         pinkConfigBeans.pinkController.showLastDayRevenueChart.doGet(showLastDayRevenueChart.java:107)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
    I m building the application in NetBeans and when runs then it runs well, even while browsing from LAN. But when I place the web folder creted under buil directory of NetBeans in the Tomcat on Linux, then it gives above error.
    Under given is the servlet code raising exception
    response.setContentType("image/jpeg"); // Assign correct content-type
    ServletOutputStream out = response.getOutputStream();
    /* TODO GUI output on JFrame */
    PinkChartFrame pinkChartFrame;
    pinkChartFrame = new PinkChartFrame(ssnGUIAttrInfo.getXjFrame(), ssnGUIAttrInfo.getYjFrame(), headingText, xCordText, yCordText, totalRevenueDataList);
    pinkChartFrame.setTitle("[::]AMS MIS[::] Monthly Revenue Chart");
    pinkChartFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    //pinkChartFrame.setVisible(true);
    //pinkChartFrame.plotDataGUI();
    int width = 760;
    int height = 460;
    try {
    BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = image.createGraphics();
    pinkChartFrame.pinkChartJPanel.paintComponent(g2);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(image);
    } catch (ImageFormatException ex) {
    ex.printStackTrace();
    response.sendRedirect("index.jsp");
    } catch (IOException ex) {
    ex.printStackTrace();
    response.sendRedirect("index.jsp");
    out.flush();
    Do resolve anybody!
    Edited by: pinkVag on Oct 15, 2007 10:19 PM

    >
    I m developing webapplication in which I made one servlet that calls JFrame developed by me, and then encoding into JPEG image to send response on client browser. I m working on NetBeans 5.5 and the same code runs well. But my hosting server is Linux and I m getting the following error:
    java.awt.HeadlessException: >That makes sense. It is saying that you cannot open a JFrame in an environment (the server) that does not support GUIs!
    To make this so it will work on the server, it will need to be recoded so that it uses the command line only - no GUI.
    What is it exactly that PinkChartFrame is generated an image of? What does it do? (OK probably 'generate a chart') But what APIs does it use (JFreeChart or such)?

Maybe you are looking for