Read Metadata from TIFF-file

Hi All!
I try to get metadata from a TIFF-file. I tried to do this with this code. Everytime i get the same error. Anyone can help me?
int imageIndex = 0;
File f = new File(sourceFile);
ImageInputStream stream = ImageIO.createImageInputStream(f);
Iterator iter = ImageIO.getImageReaders(stream);
ImageReader reader = (ImageReader)iter.next();
reader.setInput(stream);
IIOMetadata m = reader.getImageMetadata(imageIndex);
Errormessage:
run-single:
Exception in thread "main" javax.imageio.IIOException: I/O error reading image metadata!
at com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.readMetadata(Unknown Source)
at com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(Unknown Source)
at com.sun.media.imageioimpl.plugins.tiff.TIFFImageReader.getImageMetadata(Unknown Source)
at tiffmetadatabug.Main.main(Main.java:80)
Caused by: java.io.EOFException
at javax.imageio.stream.ImageInputStreamImpl.readShort(ImageInputStreamImpl.java:211)
at javax.imageio.stream.ImageInputStreamImpl.readUnsignedShort(ImageInputStreamImpl.java:222)
at com.sun.media.imageioimpl.plugins.tiff.TIFFIFD.initialize(Unknown Source)
at com.sun.media.imageioimpl.plugins.tiff.TIFFIFD.initialize(Unknown Source)
at com.sun.media.imageioimpl.plugins.tiff.TIFFImageMetadata.initializeFromStream(Unknown Source)
... 4 more
Java Result: 1

I think you should test this with one or two pictures - import/convert, save metadata to file, geotag, read metadata. Also try import/convert, make small adjustment, save metadata to file, geotag, read metadata. In iView I often write metadata to DNG's that have been adjusted, then read the metadata in Lightroom - sometimes I add more data in iView and do more adjustments.
I have seen the problem you describe, but it has been with raw files which I have adjusted in Lightroom but haven't saved out the metadata. I have then created an xmp sidecar in iView, and read the metadata in LR. So the sidecar had no ACR/LR instructions. The result was that my adjustments were wiped out. What I suspect is that something similar is happening with your DNGs - that conversion creates them but doesn't write the ACR/LR fields.
So try a few alternative sequences.
John

Similar Messages

  • Elements 12 Strips Metadata from Tiff Files When Saving?!

    When I bring a photo into Elements 12 in tiff format from Capture NX2  and edit it, then save it, the metadata gets stripped out. I want the photo to retain the metadata so that Organizer can sort my photos by data and time captured. I've verified that the metadata was present before editing the file in Elements. How can I do this? I've tried both checking and unchecking the "Ignore Camera Data" box in the Saving Files Preferences. Thanks

    Jim - of course the original is not retained: the apps are doing a safe save (where you save to a new filename, then replace the original with the duplicate in a semi-atomic way). This is done using standard OS APIs whenever possible, and is done in most applications. All file saves in Photoshop behave the same way, except maybe PDF (which is in some code we don't control) and SaveForWeb (also different code).
    Again, the root cause is an Apple bug in the way they chose to associate metadata with the files, and how they updated existing APIs to deal with the additional metadata. We might be able to work around this using new APIs -- but should apps have to change their code every time someone decides to add new metadata invisible to the app and separate from the file? Shouldn't the design of the metadata system be more robust, and work with existing applications? Shouldn't someone have thought about this before releasing a metadata system, that, well, nobody knew about?

  • How to read metadata from a pdf file

    hello
    i have got xmp sdk for windows.
    i want to read the metadata from a pdf file but i cannot
    find a way to do so.
    i cannot understand that which method to use to open the file whose metadata i want to read.
    if someone can tell me by an little code example then it would be great help.
    thanks

    The sample XAPDumper read metadata in a file (PDF or not) if it is valide. If you want to keep the XAPMeta object, don't delete this object in ProcessSubstring().

  • How to re-read metadata from file in Photoshop Elements 11 Organizer?

    I am currently testing Lightroom 4 and Photoshop Elements 11 as a replacement for my old softwarestack due to a new DSLR.
    In Lightroom I can read and write metadata directly from/to file. In Photoshop Elements Organizer I have found an option to write tags to files, but none to re-read the metadata after the files has been imported to the catalog.
    I would like to use Lightroom as primary organizer for import/tagging/basic corrections. But Lightroom does not have some nifty things like face/person recognition and SmartTags, so I need the Photoshop Elements Organizer to do that. The target workflow would be:
    DSLR -> Import to -> Lightroom -> tagging -> basic corrections -> write tags to file in Lightroom -> import to PSE organizer -> person recognition -> smart tags -> image edits -> write tags to files in PSE organizer ==> tags can now be re-read in Lightroom, so I get the PSE organizer changes to Lightroom.
    And that is the problem: If changes were made after this workflow in Lightroom, PSE Organizer does not know that until I can re-read the metadata from the files. If I press "write tags to file" in PSE organizer all newer Lightroom tags will be overwritten with the old tags from PSE organizer.
    Does anyone knows a solution for this problem? Or should I file a feature request for both programs?

      You can now do a lot more in the metadata panel in PSE 11. If you select a thumbnail in Organizer and click the three small dots it will bring up a dialog for the metadata fields. To add information to many photos all at once, select all the thumbnails, click the information tab and then click the button marked Add IPTC information. You can then choose to append new information to all of the selected items or to overwrite.
    See image below

  • Bug: Keywords behave incorrectly after "Read Metadata from File"

    (Happens in LR3.4 RC and probably also in previous versions... but I am not sure if it happened in LR2)
    The problem seems tro be somthing like de-sync of database status and what we see on the screen.
    1) Let's say we have a photo with keyword "abc"
    2) Click in the Keyword List on the arrow around the "abc" keyword to show only photos with this keyword (single one), leave the filter on this settings
    2) Save Metadata to File
    3) Edit XMP in an external application, add new keyword "def"
    4) Read Metadate from File
    5) Now what happens is: The photos disappers from the screen as if it lost the "abc" keyword (weird), but if you look at the Keyword List, the "abc" keyword has still 1 photo attached to it. Also, if you release the filter and find the photo, it clearly has the "abc" and "def" keywords in the Keywording panel. And you can search for this keyword in the text filter (works correctly), but if you click on the arrow around the "abc" keyword, the photo is not shown.
    6) If you restart the Lightroom, it will work correctly again.
    I have an own application that is able to modify the XMP and the modifications may not be perfect, but in my opinion, this shouldn't happen when reading the metadata. If any developer is reading this, I can supply a file with original and changed metadata for debugging.
    It would be great it this could be resolved.
    Thanks!

    Please do report your find with the details you state (well done!) here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    Thanks.........

  • TIFF-VIs for reading/writing from/to files

    To whom it may concern,
    I'm looking for TIFF-VIs for reading/writing from/to files
    for Labview 6 without any add-on package.
    Unfortunately I can't use TiffRd04 and TiffSv05 from
    Koji Ohashi due to the different file format!
    Any hints?
    Thank you in advance. Best regards from Germany
    Udo Weik

    Hi Udo,
    did you check these TIFF related libraries? .. maybe one of them is working.
    Good Luck

  • Bug: "Read metadata from file"

    When I add GPS coordinates to a file (with the program Geotagger) and select "read metadata from file" to import the new metadata, a color adjustment badge appears on the thumbnail (even though I didn't adjust any colors). This only happens with files that have a cropping applied to them in Lightroom. If the file doesn't have a custom cropping the color adjustment badge doesn't appear. It happens with both JPG and CR2 files. Seams like a bug to me.
    I'm on a 24" iMac 2.8 with 4 GB and OSX 10.5.5 / Lightroom 2.1

    It also happens with DNG. Anyway, I don't think it has anything to do with the GPS, but the issue has been around right back through version 1.x Try the following:
    1. Select an image that has no crops or develop adjustments
    2. Switch to Develop module
    3. Apply a crop
    4. Save metadata to file (Cmd+S)
    5. Read metadata back from file (Metadata menu - "Read Metadata from file"
    Please report what happens?
    At my end the Crop badge remains but a Develop Adjustment badge also appears - IMO it shouldn't, but as stated above it has for a VERY long time. I'll bug it again and see what happens.

  • Batch read metadata from file

    Hi Everybody,
    I wonder if Lightroom 3 offers a function that lets me read metadata from file for multiple images in a batch process. The reason is that I have changed the GPS information for quite a couple of my pics using the Geoencoding Support pluging from Jeffrey Friedl and let it write back into the DNG-file. Since I also flushed the shadow data I can't see any GPS information in my metadata table in Lightrrom even though the data are present in the DNG. Now the real question is: Is there a better way to get my GPS data into Lightroom than emptying the Library and reimport all of my pics?
    Oh, and before I forget it: Yes, I have searched this forum - and a couple of others as well - and I found stuff about batch processing date/time information. However, the method presented there apparently does not apply to my problem.
    Thanks for any information.
    Have a nice day,
    f.

    In Library Module, select Grid Mode. Select all images you wish to read metadata from. Go to Metadata>Read Metadata from Files
    Similarly, you can edit time for time zone/ AM-PM issues, etc by going to Metadata>Edit Capture Time

  • Reading Metadata From File Resets the Setting

    I am using Lightroom 4 on MAC OS X Yosemite. I have done some editing on a picture in DNG format and then clicked "Save Metadata to File".  I checked the XMP file with textedit and found that the change is indeed saved. But when I click "Read Metadata From File", it resets the pictures before any editing. Please, I need help to fix this problem.

    jinsheng wrote:
    I have done some editing on a picture in DNG format and then clicked "Save Metadata to File".  I checked the XMP file with textedit and found that the change is indeed saved.
    I'm confused - I'm pretty-sure Lightroom 4 will not save changes to an xmp file (even if DNG is read-only, unlike Bridge) - it embeds the metadata in the DNG file. Did you mean you edited the DNG file with a text editor? Anyway, if you do have a .xmp sidecars to your DNG, I recommend deleting them, or renaming them (until you figure out what's going on anyway), then retry - any difference?
    PS - last I checked, Lr will generate an error when saving metadata if DNG is read-only, but since you're having a strange problem, I'd definitely make sure they are not read-only.
    Note: Lr WILL read metadata from an xmp sidecar, *iff* it seems newer than what is embedded. So, IF you have xmp sidecars that have a recent modification date, or *maybe* (I don't really know) if Lr was NOT able to successfully embed metadata into your DNG, it could be reading some incompatible metadata from the xmp sidecar - thus the reason to get it out of the way to test..

  • Looking for pure Java API to read metadata from an MP4 file.

    Hi, I am looking for a pure Java api that can read MP4 metadata. I have been trying to look online for one but have not found anything
    suitable. If there are no good api's, can someone point me to resources on how to parse metadata from an MP4, tutorials would be great
    as well. I have looked online for that as well but have not found much. Any help would be greatly appreciated.

    Cross posted
    http://www.java-forums.org/new-java/59652-looking-pure-java-api-read-metadata-mp4-file.html
    http://www.coderanch.com/t/580833/Streams/java/Looking-pure-Java-API-read
    http://stackoverflow.com/questions/10568588/looking-for-pure-java-api-to-read-metadata-from-an-mp4-file
    db

  • Read metadata from file cancel modifications !

    Hi,
    I use Lightroom 1.1 in french. I made some photo (in raw but in jpeg the result is the same) and import them in Lightroom with conversion in DNG. In Lightroom, in develop module, I crop, change contrast and som others.
    After that, I geotag my DNG files with HoudahGeo. HoudahGeo write geotag in the file. So back in Lightroom, I make a 'Read metadata from file' ('Lire les métadonnées depuis les fichiers' in french) for having geotag in Lightroom.
    Geotag are now in Lightoom, nice, but in develop history, I have a new line 'Rénitialiser les paramètres' !!! So I can't see all my modifications... Is it normal ?
    Thank you
    PS: Sorry for my english...

    I think you should test this with one or two pictures - import/convert, save metadata to file, geotag, read metadata. Also try import/convert, make small adjustment, save metadata to file, geotag, read metadata. In iView I often write metadata to DNG's that have been adjusted, then read the metadata in Lightroom - sometimes I add more data in iView and do more adjustments.
    I have seen the problem you describe, but it has been with raw files which I have adjusted in Lightroom but haven't saved out the metadata. I have then created an xmp sidecar in iView, and read the metadata in LR. So the sidecar had no ACR/LR instructions. The result was that my adjustments were wiped out. What I suspect is that something similar is happening with your DNGs - that conversion creates them but doesn't write the ACR/LR fields.
    So try a few alternative sequences.
    John

  • Feature Request: save metadata to file, and read metadata from file.

    Please have function to save metadata to file, and read metadata from file.
    This would allow us to write cross-platform plugins that can assure data is up-to-date in the xmp, or modify xmp and have it reinstated in the catalog.
    This would go nicely with the ability to save xmp for virtual copies, dng, and rgb formats.

    Perhaps someone with direct experience with publishing to Smugmug will chime in.  Short of that, some thoughts on your issues:
    Should I not bother to "Save Metadata to File", this seems to be what is messing up the SmugMug publish service?
    I very much doubt that it is messing up the publishing.  What gets saved to the file from the catalog is independent of what gets exported.  Saving metadata to the file is generally a good practice (in case you screw up your catalog backups).  Many, perhaps most, users set the preference Catalog Settings > Automatically Write Changes Into XMP.
    I would have expected it to behave like an export which would write synonyms, exclude keywords that should be excluded, etc, which seems to work ok in point 6 above.
    Yes, that's a reasonable expectation.
    You may have done this already, but double-check: Right-click the Smugmug publishing service in the left-hand column of the Library, select Edit Settings, and in the Metadata section verify that you have Include: All Metadata set.
    Did you download the Smugmug plugin from Smugmug? You might try this Smugmug plugin instead -- the author designed the publishing architecture of LR and has an excellent reputation. 
    Are the publish services more effort than they are worth? So I get SmugMug to work, what happens when I try Flickr?
    I think many users find the publishing services are generally worthwhile.  I publish regularly to Flickr (using the built-in Flickr plugin, which isn't completely reliable) and the Zenfolio plugin from Friedl. 

  • Error: Could not read Metadata from Portal Database !

    Hi All!
    My problem is when i am trying to open the portal page (Oracle 10G)
    http://domain/portal/page?_pageid=6,1,6_13&_dad=portal&_schema=PORTAL
    then i have an Error: Could not read Metadata from Portal Database.
    And i do not know why because everything is up and running. I can connect and browse my database schema with portal user. I can connect to pls/orasso and where ever i want.
    [07/Feb/2006:00:57:23 +0100] "GET /pls/portal/htp.p?cbuf=Test HTTP/1.1" 200 5
    plz help i am trying to fix this in the last 2 weeks :)
    thx kEndE

    Hi Andreas,
    I've changed the permissions to 775 and changed the ownership of /sapcd (volume name) to orasid:dba (including all files within the staging area /sapcd/ora-patch).
    So the permissions and ownership seems to be fine.
    I've also ran your suggested commands but the issue still exists.
    I'm now liasing with our UNIX guy to check if there is any underlying permission issues on the volume (sapcd) that may be causing this problem.
    In the mean time, let me know if you have any further thoughts.
    Thanks,
    Chris

  • Extract metadata from selected files in bridge

    I used to use extensis portfolio to quickly export metadata from selected files to create print worksheets. I could customize which metadata would be displayed.
    For instance:
    Thumbnail
    title
    pixels
    file type
    date created and modified
    height and width
    dpi
    embedded icc profile
    file location
    iptc description
    It was a quick drag and drop process, but portfolio is now only available in the server edition for over $1000. Does anyone have script for Mac OS that would accomplish this?
    Thanks!

    Hi Xiaojing,
    Thank you for your answer. It is useful.
    The problem is: My application is not going to play music or video, it just needs to browse over the disk and create a list of available music files including info like song name, album, artist. All this info is kept in meta-data. Some users can have a lot of music of their computers. That's why I don't want to load the whole file and wait for onMetaData event - it can take a long time. I just want to read the meta-data from the file, but not to load the all file as I need for listening the music of playing the movie.
    I already applied extracting meta-data for MP3 files exactly the way you mentioned, it works fine. I only have to wait for Event.ID3 – I implemented Timer to wait until all my files are processed. Probably, if user has a lot of music on his computer, it will take a lot of time.
    I can try to read AAC the way you advice.
    I am really looking for implementation of your advice for reading the music file as a ByteArray and extracting meta-data. In this case we don't need to load all the file, but just to read part of it.
    Do you have some code implementation?
    Thank you again for your response,
    Elena

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

Maybe you are looking for