Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Metadata Extraction for CRW files- please help urgent

Avatar

Level 2

HI, 

we want to extract Metadata for CRW files. 

we are using this code of JRAWIO- 

File file = new File("DSC1234.NEF"); ImageReader reader = ImageIO.getImageReaders(file).next(); reader.setInput(ImageIO.createImageInputStream(file)); IIOMetadata metadata = reader.getImageMetadata(0);

 

By this code, we are successful in extracting metadata fro CR2 files. but CRW is still not working. 

please help in extracting metadata for CRW files, by this code or by any other code.. 

Its given that above code supports CRW file. 

http://jrawio.rawdarkroom.org

please help

1 Accepted Solution

Avatar

Correct answer by
Level 10

Out of the box we have limited support here. In the library you are using are you sure the image is generated from one of supported cameras[1]?

[1]   http://jrawio.rawdarkroom.org/supported-cameras/

View solution in original post

7 Replies

Avatar

Level 10

Can you please provide more details on what you want to do. You want AEM to be able to extract data from CRW files? 

Avatar

Correct answer by
Level 10

Out of the box we have limited support here. In the library you are using are you sure the image is generated from one of supported cameras[1]?

[1]   http://jrawio.rawdarkroom.org/supported-cameras/

Avatar

Level 2

sir How to map this IIOMetadata to CQ Dam format (like for jpeg or dng format how we see the metadata in CRDX lite)

I m getting IIOMetadata object, but now I have to map this metadta.

CQ devloper using ExtractedMetadata object to mapping(i think, not sure)

so either i have to convert IIOMetadata to ExtractedMetadata object, 

or I have to map IIOMetadata object(so that it can appear like how jpeg or dng appear whenwe go to crdx lite)

Thanks a lot for answering my question. 

 

thank you.

saurabhsharma0201@gmail.com

Avatar

Level 10

Yes you need to use ExtractedMetadata and inserts extracted value from IIOMetadata

Avatar

Level 2

hi sir, 

thanks for answer, 

but can you please elaborate how to do that. (I am new to cq)

since IIOMetadata is kind of abstract tree,

so i really do not know how to extract value form Metadata, and inserts these values. I have jars, but there was nothing i found on internet how to that. 

 

NOte:  currently what I am doing, is- converting IIOMetadta to node and then to XML input string and hence using Session.importXml method. but its coming buggy, means its not proper. like its not simile to what we see for other images. 

so please guide me, either by your new process or by working on the method which I am already using. You can refer to my screen shot which i am attaching. 

please sir help me out

Avatar

Level 2

hi sir, I am using this code for Converting IIOMetadata to jar,

and result i have posted in my other commentt please do help.      

attaching the xml data, which i m printing via string, in the doc file. please do look.                 

 

String[] mdatanames = metadata.getMetadataFormatNames();

String mdataname = mdatanames[0];

Node metadatadom = metadata.getAsTree(mdataname);

DOMSource source = new DOMSource(metadatadom);

 

ByteArrayOutputStream os = new ByteArrayOutputStream();

StreamResult result = new StreamResult(os);

Transformer transformer = TransformerFactory.newInstance().newTransformer();

transformer.transform(source, result);

ByteArrayInputStream bais =     new ByteArrayInputStream(os.toByteArray());

String nodePath1 = asset.getPath() + "/jcr:content/metadata" ;

session.importXML(nodePath1, bais, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);