Package com.drew.metadata

Examples of com.drew.metadata.Metadata


    {
        // this image was created via a resize in ACDSee
        // it seems to have a reference to an IFD starting outside the data segment
        // i've noticed that ACDSee reports a Comment for this image, yet ExifReader doesn't report one
        String fileName = "src/com/drew/metadata/exif/test/crash01.jpg";
        Metadata metadata = new ExifReader(new File(fileName)).extract();
        assertTrue(metadata.getDirectory(ExifDirectory.class).getTagCount() > 0);
    }
View Full Code Here


    public void setUp() throws JpegProcessingException, FileNotFoundException
    {
        // use a known testing image
        File jpegFile = new File("src/com/drew/metadata/jpeg/test/simple.jpg");
        JpegReader reader = new JpegReader(jpegFile);
        Metadata metadata = reader.extract();
        assertTrue(metadata.containsDirectory(JpegDirectory.class));
        _directory = (JpegDirectory)metadata.getDirectory(JpegDirectory.class);
    }
View Full Code Here

    }

    public void testThumbnailOffset() throws Exception
    {
        String fileName = "src/com/drew/metadata/exif/test/manuallyAddedThumbnail.jpg";
        Metadata metadata = new ExifReader(new File(fileName)).extract();
        Directory directory = metadata.getDirectory(ExifDirectory.class);
        assertEquals(192, directory.getInt(ExifDirectory.TAG_THUMBNAIL_OFFSET));
    }
View Full Code Here

    }

    public void testThumbnailLength() throws Exception
    {
        String fileName = "src/com/drew/metadata/exif/test/manuallyAddedThumbnail.jpg";
        Metadata metadata = new ExifReader(new File(fileName)).extract();
        Directory directory = metadata.getDirectory(ExifDirectory.class);
        assertEquals(2970, directory.getInt(ExifDirectory.TAG_THUMBNAIL_LENGTH));
    }
View Full Code Here

    }

    public void testDateTime() throws Exception
    {
        String fileName = "src/com/drew/metadata/exif/test/manuallyAddedThumbnail.jpg";
        Metadata metadata = new ExifReader(new File(fileName)).extract();
        Directory directory = metadata.getDirectory(ExifDirectory.class);
        assertEquals("2002:11:27 18:00:35", directory.getString(ExifDirectory.TAG_DATETIME));
    }
View Full Code Here

    }

    public void testXResolution() throws Exception
    {
        String fileName = "src/com/drew/metadata/exif/test/manuallyAddedThumbnail.jpg";
        Metadata metadata = new ExifReader(new File(fileName)).extract();
        Directory directory = metadata.getDirectory(ExifDirectory.class);
        Rational rational = directory.getRational(ExifDirectory.TAG_X_RESOLUTION);
        assertEquals(72, rational.getNumerator());
        assertEquals(1, rational.getDenominator());
    }
View Full Code Here

    }

    public void testYResolution() throws Exception
    {
        String fileName = "src/com/drew/metadata/exif/test/manuallyAddedThumbnail.jpg";
        Metadata metadata = new ExifReader(new File(fileName)).extract();
        Directory directory = metadata.getDirectory(ExifDirectory.class);
        Rational rational = directory.getRational(ExifDirectory.TAG_Y_RESOLUTION);
        assertEquals(72, rational.getNumerator());
        assertEquals(1, rational.getDenominator());
    }
View Full Code Here

    }

    public void testCompression() throws Exception
    {
        String fileName = "src/com/drew/metadata/exif/test/manuallyAddedThumbnail.jpg";
        Metadata metadata = new ExifReader(new File(fileName)).extract();
        Directory directory = metadata.getDirectory(ExifDirectory.class);
        // 6 means JPEG compression
        assertEquals(6, directory.getInt(ExifDirectory.TAG_COMPRESSION));
    }
View Full Code Here

    {
        // an error has been discovered in Exif data segments where a directory is referenced
        // repeatedly.  thanks to Alistair Dickie for providing the sample image used in this
        // unit test.
        File metadataFile = new File("src/com/drew/metadata/exif/test/recursiveDirectories.metadata");
        Metadata metadata = new ExifReader(JpegSegmentData.FromFile(metadataFile)).extract();
        metadata.getDirectory(ExifDirectory.class);
//        String fileName = "src/com/drew/metadata/exif/test/recursiveDirectories.jpg";
//        Metadata metadata = new ExifReader(new File(fileName)).extract();
//        metadata.getDirectory(ExifDirectory.class);
    }
View Full Code Here

    }

    protected void setUp() throws Exception
    {
        File nikonJpeg = new File("src/com/drew/metadata/exif/test/nikonMakernoteType2b.jpg");
        Metadata metadata = JpegMetadataReader.readMetadata(nikonJpeg);
        _nikonDirectory = (NikonType2MakernoteDirectory)metadata.getDirectory(NikonType2MakernoteDirectory.class);
        _exifDirectory = (ExifDirectory)metadata.getDirectory(ExifDirectory.class);
    }
View Full Code Here

TOP

Related Classes of com.drew.metadata.Metadata

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.