Package org.apache.tika.parser.image.xmp

Examples of org.apache.tika.parser.image.xmp.JempboxExtractor


            }
        };
        new ImageMetadataExtractor(metadata).parseJpeg(first);
        stream.reset();
       
        new JempboxExtractor(metadata).parse(stream);

        XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
        xhtml.startDocument();
        xhtml.endDocument();
    }
View Full Code Here


        metadata.set(Metadata.DESCRIPTION, "old description");
        metadata.set(Metadata.CREATOR, "previous author");
        // ... or kept in case the field is multi-value
        metadata.add(Metadata.SUBJECT, "oldkeyword");
       
        JempboxExtractor extractor = new JempboxExtractor(metadata);
        extractor.parse(stream);
       
        // DublinCore fields
        assertEquals("Tosteberga \u00C4ngar", metadata.get(Metadata.TITLE));
        assertEquals("Bird site in north eastern Sk\u00E5ne, Sweden.\n(new line)", metadata.get(Metadata.DESCRIPTION));
        assertEquals("Some Tourist", metadata.get(Metadata.CREATOR));
View Full Code Here

    public void testParseJpegPhotoshop() throws IOException, TikaException {
        Metadata metadata = new Metadata();
        InputStream stream = getClass().getResourceAsStream("/test-documents/testJPEG_commented_pspcs2mac.jpg");
      
        JempboxExtractor extractor = new JempboxExtractor(metadata);
        extractor.parse(stream);
       
        // DublinCore fields
        assertEquals("Tosteberga \u00C4ngar", metadata.get(Metadata.TITLE));
        assertEquals("Bird site in north eastern Sk\u00E5ne, Sweden.\n(new line)", metadata.get(Metadata.DESCRIPTION));
        assertEquals("Some Tourist", metadata.get(Metadata.CREATOR));
View Full Code Here

   
    public void testParseJpegXnviewmp() throws IOException, TikaException {
        Metadata metadata = new Metadata();
        InputStream stream = getClass().getResourceAsStream("/test-documents/testJPEG_commented_xnviewmp026.jpg");
      
        JempboxExtractor extractor = new JempboxExtractor(metadata);
        extractor.parse(stream);
       
        // XnViewMp fields not understood by Jempbox
        assertEquals("Bird site in north eastern Sk\u00E5ne, Sweden.\n(new line)", metadata.get(Metadata.DESCRIPTION));
        Collection<String> keywords = Arrays.asList(metadata.getValues(Metadata.SUBJECT));
        assertTrue(keywords.contains("coast"));
View Full Code Here

        assertTrue(keywords.contains("coast"));
        assertTrue(keywords.contains("nature reserve"));
    }
   
    public void testJoinCreators() {
        assertEquals("Mr B", new JempboxExtractor(null).joinCreators(
                Arrays.asList("Mr B")));
        // TODO use multi-value property instead?
        assertEquals("Mr B, Mr A", new JempboxExtractor(null).joinCreators(
                Arrays.asList("Mr B", "Mr A")));
    }
View Full Code Here

        metadata.set(TikaCoreProperties.DESCRIPTION, "old description");
        metadata.set(TikaCoreProperties.CREATOR, "previous author");
        // ... or kept in case the field is multi-value
        metadata.add(TikaCoreProperties.KEYWORDS, "oldkeyword");
       
        JempboxExtractor extractor = new JempboxExtractor(metadata);
        extractor.parse(stream);
       
        // DublinCore fields
        assertEquals("Tosteberga \u00C4ngar", metadata.get(TikaCoreProperties.TITLE));
        assertEquals("Bird site in north eastern Sk\u00E5ne, Sweden.\n(new line)", metadata.get(TikaCoreProperties.DESCRIPTION));
        assertEquals("Some Tourist", metadata.get(TikaCoreProperties.CREATOR));
View Full Code Here

    @Test
    public void testParseJpegPhotoshop() throws IOException, TikaException {
        Metadata metadata = new Metadata();
        InputStream stream = getClass().getResourceAsStream("/test-documents/testJPEG_commented_pspcs2mac.jpg");
      
        JempboxExtractor extractor = new JempboxExtractor(metadata);
        extractor.parse(stream);
       
        // DublinCore fields
        assertEquals("Tosteberga \u00C4ngar", metadata.get(TikaCoreProperties.TITLE));
        assertEquals("Bird site in north eastern Sk\u00E5ne, Sweden.\n(new line)", metadata.get(TikaCoreProperties.DESCRIPTION));
        assertEquals("Some Tourist", metadata.get(TikaCoreProperties.CREATOR));
View Full Code Here

    @Test
    public void testParseJpegXnviewmp() throws IOException, TikaException {
        Metadata metadata = new Metadata();
        InputStream stream = getClass().getResourceAsStream("/test-documents/testJPEG_commented_xnviewmp026.jpg");
      
        JempboxExtractor extractor = new JempboxExtractor(metadata);
        extractor.parse(stream);
       
        // XnViewMp fields not understood by Jempbox
        assertEquals("Bird site in north eastern Sk\u00E5ne, Sweden.\n(new line)", metadata.get(TikaCoreProperties.DESCRIPTION));
        Collection<String> keywords = Arrays.asList(metadata.getValues(TikaCoreProperties.KEYWORDS));
        assertTrue(keywords.contains("coast"));
View Full Code Here

        assertTrue(keywords.contains("nature reserve"));
    }
   
    @Test
    public void testJoinCreators() {
        assertEquals("Mr B", new JempboxExtractor(null).joinCreators(
                Arrays.asList("Mr B")));
        // TODO use multi-value property instead?
        assertEquals("Mr B, Mr A", new JempboxExtractor(null).joinCreators(
                Arrays.asList("Mr B", "Mr A")));
    }
View Full Code Here

TOP

Related Classes of org.apache.tika.parser.image.xmp.JempboxExtractor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.