Reading Image Metadata..

Hi,
I am converting some PHP pages to JSP. There is an image gallery page where images are being displayed and also the comment and Author names is displayed under that image.Those things are set as image metadata.
The code for doing this in PHP looks like....
$exif = exif_read_data($full_file_path, 0, true);
foreach ($exif as $key => $section)
                                        foreach ($section as $name => $val)
echo $section['Comments'];
echo $section['Author'];
How can I achieve this in java i.e. how can I read author and comment metadata fields using java....
Thanks & Regards
Shailesh

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

Similar Messages

  • Read image metadata

    Hi All,
    Question: Can we read image meta data from CS extension code by any way ?
    I tried it with xmp core library and passed a jpeg file to xmpMeta object which expect a String, a XML or Byte Array as argument:
    private function getImageMetadata(jpeg:File):void
                                  var meta:XMPMeta = new XMPMeta(jpeg);
                                  var packet:XML = meta.serializeToXML();
                                  var photoshop:Namespace = XMPConst.photoshop;
                                  var value:String = meta.photoshop::AuthorsPosition;
    If I was able to convert jpeg file to Byte Array, I my guess to be work but I'm not able to find it workable.
    Can someone help me to complete the task?
    Thanks
    Mac

    Hi All,
    Question: Can we read image meta data from CS extension code by any way ?
    I tried it with xmp core library and passed a jpeg file to xmpMeta object which expect a String, a XML or Byte Array as argument:
    private function getImageMetadata(jpeg:File):void
                                  var meta:XMPMeta = new XMPMeta(jpeg);
                                  var packet:XML = meta.serializeToXML();
                                  var photoshop:Namespace = XMPConst.photoshop;
                                  var value:String = meta.photoshop::AuthorsPosition;
    If I was able to convert jpeg file to Byte Array, I my guess to be work but I'm not able to find it workable.
    Can someone help me to complete the task?
    Thanks
    Mac

  • Read Image XMP Metadata

    Hi All,
    Hope I'm not spamming  this thread to your mailbox as I felt this question asked in unrelated  forum.
    Question: Can we read image meta data from Flex ?
    I tried it with xmp core library and passed a jpeg file to xmpMeta object :
    private function getImageMetadata(jpeg:File):void
                                  var meta:XMPMeta = new XMPMeta(jpeg);
                                  var packet:XML = meta.serializeToXML();
                                  var photoshop:Namespace = XMPConst.photoshop;
                                  var value:String = meta.photoshop::AuthorsPosition;
                                    trace(value); // returns null, not sure why
    Can any one help me to get the image metadata.
    Thanks in advance
    Mac

    I've got some content related to my issue from net but still it won't solve my problem
    private function init():void {
                                            var ldr:Loader = new Loader();
                                            ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
      var s:String = "my/jpgPath/myjpgName.jpg";
                                            ldr.load(new URLRequest(s));
                                  private function imgLoaded(e:Event):void{
                                            var info:LoaderInfo = e.target as LoaderInfo;
                                            var xmpXML:XML = getXMP(info.bytes);
      //trace(xmpXML);
                                            var meta:XMPMeta = new XMPMeta(xmpXML);
      //var packet:XML = meta.serializeToXML();
                                            var photoshop:Namespace = XMPConst.photoshop
                                            trace(meta.photoshop::AuthorsPosition);
                                  private function trim(s:String):String{
      return s.replace( /^([\s|\t|\n]+)?(.*)([\s|\t|\n]+)?$/gm, "$2" );
                                  private function getXMP(ba:ByteArray):XML{
                                            var LP:ByteArray = new ByteArray();
                                            var PACKET:ByteArray = new ByteArray();
                                            var l:int;
                                            ba.readBytes(LP, 2, 2);
                                            http://www.adobe.com/devnet/xmp.html
                                            read part 3: Storage in Files.
                                            that will explain the -2 -29 and other things you see here.
                                            l = LP.readInt() - 2 -29;
                                            ba.readBytes(PACKET, 33, l);
                                            var p:String = trim(encode(PACKET) as String);
      var i:int = p.search('<x:xmpmeta xmlns:x="adobe:ns:meta/"');
      /* Delete all in front of the XMP XML */
                                            p = p.substr(i);
                                            For some reason this left some rubbish in front, so I'll hardcode it out for now
                                            TODO clean up
                                            var ar:Array = p.split('<');
                                            var s:String = "";
                                            var q:int;
                                            var j:int = ar.length;
                                            for(q=1;q<j;q++){
                                                      s += '<'+ar[q];
                                            i = s.search('</x:xmpmeta>');
                                            i += ('</x:xmpmeta>').length;
                                            s = s.slice(0,i);
      /* Delete all behind the XMP XML */
                                            return XML(s);
                                  private static function encode(ba:ByteArray):String {
      var origPos:uint = ba.position;
      var result:Array = new Array();
       for (ba.position = 0; ba.position < ba.length - 1; )
       result.push(ba.readShort());
      if (ba.position != ba.length)
       result.push(ba.readByte() << 8);
      ba.position = origPos;
                                                      return String.fromCharCode.apply(null, result);
    It seems there is a bug in XMPMeta class where it always throws an exception "The XMPMeta object cannot have qualifiers", Even created with default (no param).
    Does anyone have any clue on this? please help
    Thanks
    Mac

  • Read-image-file show jpeg photo cause error

    I use read-image-file to show a jpeg photo (edited by ACDSEE) cause frm-47100. I know that Oracle may not support the Jpeg format of ACDSee. But, anyone know how to solve this problem. (I have to keep using ACDSee)

    If you remove the metadata from a JPEG it should usually do the trick. I don't know how to do that in ACDSee, though.

  • LR 1.4.1 not reading GPS metadata

    I recently geotagged a number of files (Nikon NEF) that I had previously imported into LR. I know I should have geotagged first, but oh well. Anyway, I tagged the photos in a separate directory (made a "working" directory for the tagging in case something went wrong) then copied the files back to the original directory, overwriting the untagged versions. I opened LR and did a "Synchronize folders" choosing only to sync metadata. In Library view, with the metadata pane set to "all" I still do not see GPS info. Any thoughts? This is my first try at geotagging, so I could easily have done something wrong.
    Update: I did a test image (to which I had not made any changes) and chose "Read metadata from file" instead. The GPS info appeared. Of course, this poses a problem since that action on a larger scale will overwrite keywording, etc on the files. Definitely not an option.

    OK Carl that makes more sense. The first question is did you update the images metadata from within LR before geotagging it outside of LR? If you do this then any geotagging you add to the file will only add to the metadata not delete any. It sounds very much as though you didn't update the file from within LR first. Now, having said that I'm not entirely sure how much is saved in the database and how much is saved in the metadata itself - I have a sneaky suspicion not everything and perhaps a quick visit to the FAQ's might help here or someone else will jump in.
    A little OT I know but seeing as how you mentioned it. I am not a big fan of geotagging tracks from my unit (Garmin 60CSx) as I find the accuracy is dependent upon several variables e.g. how often the unit records a point and are the unit and cameras clocks exactly in sync. My preferred method is to set a Waypoint changing the default name to that of the image number. Back on the puter it's simply a case of marrying up the image number and the Waypoint number which is dead easy with my preferred geotagging application - RoboGeo.

  • Update image metadata programatically

    Hi
    I developed a plugin, which changes exif information of the image (using a third party program). Is there a way to inform Lightroom programatically to refresh image metadata? Right now I have to right-click on the folder and choose "Synchronize Folder...".

    There's at least one ODBC driver for SQLLite http://www.ch-werner.de/sqliteodbc/, and maybe command line access to the database too
    But there's nothing directly through Lightroom, and you won't be able to code Lightroom to refresh EXIF data. There is no coding mechanism to write to EXIF fields or to refresh the image (ie sadly you can't automate Metadata > Read Metadata).
    If you write directly to the SQL while LR is open, the best you can expect is that the EXIF will use updated data from the database when you next click on that image in Library. However, you are likely to encounter database locking problems  and stand a good chance of corrupting the database. Abandon all hope, ye who enter here?

  • Muse image metadata and global caption styling

    When will Muse be able to import image metadata and perform global caption styling with accurate positioning for lightboxes and slideshows?

    I've done some testing.
    if images are uploaded to the Facebook Wall, the Comments field that Aperture presents before uploading the image becomes the Description field on Facebook.
    however, if the images are uploaded to a known Facebook Album, the Version Name becomes the Description.
    both of these situations are not logical. in the case of uploading to the Wall, 'Comments' should probably be 'Description'. I'll report them to Apple's bugreport.
    images seem to be scaled down to fit within 2048x2048 pixels.

  • Image metadata is not retained(stripped) in lightbox slideshow widget

    How is this corrected

    Can someone at Adobe please confirm that there is no reading of the image metadata.  I thought it was limiting that it was only the caption field available.  I am stunned if this is the case that no metadata is being read.  I am working on a photo web site and got to the point of importing photos with the 'captions' checked.  Huge surprise.  It is hard to believe that something as fundamental as basic metadata fields (caption, title, filename, copyright) isn't pulled with the image and available as needed.  C'mon, you are the company that has Photoshop and Lightroom.  Do you guys talk to the other teams?
    I was looking at Muse galleries as an alternative to the LR web module for 2 reasons:  one is flexibility in layout, and the other is speed, since the LR gallery export cranks along at a glacial pace to the point of being almost unusable.  And this is the LR4 upgrade; much slower than LR3.  See the LR threads on this if you're interested.  Still waiting for that fix.
    The thought of manually entering caption info to a dozen galleries, each with 20 or 30 images, is nonsense.  This makes Muse a non-starter for photo galleries.  This is basic capability.  Adobe should be embarrassed that LR4 doesn't do what it should in this regard, and that the feature needed don't even exist in Muse.  Everyone expects a few bugs in the early days of a new software, but not missing essential, fundamental features to make web galleries useful. 
    Rant now over and I will happily apologize if the metada fields are, indeed, available.  Please explain how.  Thanks.

  • Image Metadata Editor

    I have been looking for inserting descriptions into my pictures. Unfortunately, there isn't any option to edit Metadata in File Explorers (I tried Thunar and Nautilus). I wouldn't like to have a photo gallery software just to do that, and, by the way, I couldn't find any of those that allows me to edit metadata in a straight-forward way. I have to navigate through a lot of menus in order to do that.
    Basically, I was looking for a plugin or other software that enhanced the "Image" tab on Thunar, so I could see and edit all file metadata there. Honestly, I don't know how do you guys keep your photo albums organized without this feature.

    I've found Shotwell pretty straightforward to edit tags. However, I personally also use feh + dmenu + a script I found somewhere to view and edit metadata. The latter method I find quite speedy when I've imported a bunch of photos. The script is
    image-metadata.sh:
    #!/bin/bash
    if [ $# -lt 2 ]
    then
    echo -e usage: "$0 <action> <filename>\n actions: edit-comment, edit-tags"
    exit -1
    fi
    action=$1
    file=$2
    if [ "$action" == "edit-comment" ]
    then
    commentText=$(echo | dmenu -t "$(exiv2 -Pt -g Exif.Photo.UserComment $file)")
    if [ $? -ne 1 ] # not aborted
    then
    if [ -z "$commentText" ]
    then
    exiv2 -M"del Exif.Photo.UserComment" $file
    else
    exiv2 -M"set Exif.Photo.UserComment $commentText" $file
    fi
    fi
    fi
    if [ "$action" == "edit-tags" ]
    then
    exiv2 -Pt -g Iptc.Application2.Keywords $file > /tmp/._image_keywords.txt
    selection=$(exiv2 -Pt -g Iptc.Application2.Keywords $file | dmenu -sb "#000" -nf "#aaa" -nb "#222" -sf "#509ba6" -fn 'Deja Vu Sans Mono-14:bold' -l 10)
    if [ -n "$selection" ]
    then
    exiv2 -M "del Iptc.Application2.Keywords" $file
    while read keyword
    do
    if [ "$selection" != "$keyword" ]
    then
    exiv2 -M "add Iptc.Application2.Keywords String $keyword" $file
    else
    deleted=true
    fi
    done < /tmp/._image_keywords.txt
    if [ -z $deleted ]
    then
    exiv2 -M "add Iptc.Application2.Keywords String $selection" $file
    fi
    fi
    rm /tmp/._image_keywords.txt
    fi
    if [ "$action" == "show" ]
    then
    comment=$(exiv2 -Pt -g Exif.Photo.UserComment $file)
    exiv2 -Pt -g Iptc.Application2.Keywords $file > /tmp/._image_keywords.txt
    echo -n Comment: $comment, "Keywords: "
    first=true
    while read keyword
    do
    if [ $first == "false" ]
    then
    echo -n ", "
    fi
    echo -n $keyword
    first="false"
    done < /tmp/._image_keywords.txt
    echo
    rm /tmp/._image_keywords.txt
    fi
    It requires exiv2, iptc, and dmenu. (Also ttf-dejavu, but you can edit out that font choice ) The script is not mine; unfortunately, I cannot remember where I found it.
    Then in .config/feh/themes, put
    tag --action2 ";/path/to/image-metadata.sh edit-comment %f" --action1 ";/path/to/image-metadata.sh edit-tags %f" --info "/path/to/image-metadata.sh show %f"
    Browse pictures with "feh -Ttag *.jpg" for instance, then press 1 to edit tags, press 2 to edit comments.

  • How do I edit image metadata?

    What I would like to be able to do is something like:
      tell application "Image Events"
      tell pic
        make new metadata tag with properties {name:"creation", value:cr}
      end tell
      end tell
    Only, sips/Image Events doesn't support setting most image metadata. Any suggestions as to how to approach this problem?

    Thanks. Lightroom 2.4, unfortunately, isn't very scriptable. This is ironic, since the program itself relies on Lua for its interface functionality. I will probably, eventually, manage to compile Exempi and the Python XMP Toolkit and do the job that way.
    Refs:
      [Exempi|http://libopenraw.freedesktop.org/wiki/Exempi]
      [Python XMP Toolkit|http://www.spacetelescope.org/projects/python-xmp-toolkit/docs/index.ht ml]

  • Reading JPEG metadata

    Is it possible to read the metadata from an imported JPEG or a JPEG selected with Image Field during execution?

    It is possible to get quite a bit of information from imported files via DataObjects, but I can't seem to get my existing description/metadata/EXIF data. Below is a code snippit showing that path and size work correctly but description does not.
    'Code for Get Data Object Button Click
    var myDoc = event.target;
    var count = 0;
    var sFile = "myFile" + count;
    myDoc.importDataObject({cName: sFile});
    var myDataObject = myDoc.getDataObject(sFile);
    var sFileName = myDataObject.path;
    count = count + 1;
    'Code to display each attached files name/size on Button Click
    var myDoc = event.target;
    var d = myDoc.dataObjects;
    for (var i = 0; i < d.length; i++)
        app.alert("Data Object[" + i + "]=" + d[i].path + "    and the file size is: " + d[i].size);
        app.alert(d[i].description); 'Does not work to pull metadata/EXIF   

  • WDS 2012 Image Capture - Stuck at 50% "Capturing Windows image metadata..."

    I have tried capturing a few images after running sysprep, and they are getting stuck at 50% completion, never moving past after hours of waiting.  "Capturing Windows image metadata...".  If I look on the WDS server I see that the file
    hasn't been modified since it was actually capturing and moving the progress bar.
    Has anyone ever experienced this, or have any ideas of how to troubleshoot?
    Thank you!

    Hi motenoob,
    What system edition and MDT edition you are capturing? If it is Windows8 or 8.1, it seems is the know issue, you can refer the following KB:
    Sysprep and Capture task sequence fails when it tries to capture Windows 8 or Windows 8.1 images
    https://social.technet.microsoft.com/Forums/en-US/4e28cac0-29e4-4f24-a8f0-30d34d543a76/wds-2012-image-capture-stuck-at-50-capturing-windows-image-metadata?forum=winserversetup
    Regards,
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Write/read image to avi file, VI works incorrectl​y from the second run

    Hi everybody, in my labview I write image from IMAQ USB to avi file and read image from avi file, the VI runs correctly at the first run then after that it goes wrong, I can write/read only one frame and it terminates automatically. Does anybody know why and how to solve this?
    Thanks a lot,
    Hannah

    Without seeing your code I can't comment specifically, but if it runs correctly the first time and then stops be looking for something that is not getting reinitialized correctly. Also what exactly do you have to do to get it to work again? Close and reopen the VI? Restart LV? Restart the computer?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Cannot read image file in oracle 10g forms, getting error frm-47100

    I'm unable to read the image from the file location. But If I do re-save via MS-Paint the same image then I'm able to load successfully. I want to load image directly instead of re-save.  Error getting like "frm-47100 Cannot read image file".
    Need your co-operation to solve this issue.
    Thanks in advance!
    declare
      tiff_image_dir varchar2(80):=('D:\IMAGE\');
      photo_filename varchar2(80);
    begin
      photo_filename:=tiff_image_dir||:IMAGE_NO||'.JPG';
      if :image_no is null then
      :Image_no :=:UID_NO;
      end if;
      read_image_file(photo_filename,'JPG','image');
      WRITE_IMAGE_FILE('output.tif','TIFF','g_image_info.image',maximize_compression,original_depth)
    end;

    Hi Sindhu,
    By default any operating system file extension starts after the dot. So in this case when it says 2 dots it will think there is something wrong.
    RajeshALex

  • Webutil Read Image Problem

    Hi,
    I am reading image from client system using the below code
    CLIENT_IMAGE.READ_IMAGE_FILE(v_rd_file_name, 'JPG', 'CTRL_BLK.ADD_IMAGE');
    But this image is not displaying in the image item, this is happening for some particular images only. While writing this image into image server image size also increasing.
    We are trying one image that dimension is 2900 X 4700 this is not uploading to image item.
    but i am able to upload less than 2000 X 2000 dimension to the same image item
    below is Image item property
    Image Format : TIFF
    Image Depth : Original
    Display Quality : Medium or High
    Sizing Style : Adjust
    Any idea on thie problem...
    Regards,
    Suresh.V

    hi
    What about Java Bean????
    try the following link i hope it will help u.
    http://forms.pjc.bean.over-blog.com/article-7109292.html
    and also u may use Irfan viewer to resize the image.Did u try to use Crop?
    sasrah

Maybe you are looking for

  • Heating problem with HP TouchSmart 600-1050sc

    Hi There.. Got this recurring problem on my HP TouchSmart 600-1050sc. (No changes made to org. config) Every time i open more then 2 browser windows, or set up more than one game client, the cooling fan goes into a frenzy. ;o( On my old stationary co

  • Sony NSZ-46GT1 Internet TV - Home Theather

    I have purchased a Somy smart TV with Google and was wondering what Home Theather System I should purchase.   Blue Ray player / no Blue Ray ,  Stay with Sony or go with something different ?  Any help out there ?

  • ** End-to-End Monitoring - RFC destination error while save config in RWB

    Hi Friends, We have 2 RFC destinations in our XI server. 1) PMI<client>001 2) PMI<client><client>800. First one is for XI server. Next one is for Sender/Receiver System. We want to activate End-to-End Monitoring in RWB. For this, when I save configur

  • Field Order for Upscaling DVD player

    I have a edited HDV project that I have output to DV using the following settings: Video Compressor - DV NTSC Field Order: Lower Field First When I play this on a standard DVD player everything looks fine. The field order looks correct and the object

  • Cannot access iPad's App Update

    I have 6 updates but the ITunes Update App won't load.