Package com.drew.metadata

Examples of com.drew.metadata.MetadataException


    }

    private static Wpt wptFromGpsTag(Directory gps) throws MetadataException{
        Wpt result = null;
        if(!gps.containsTag(GpsDirectory.TAG_GPS_LATITUDE)){
           throw new MetadataException("GPS latitude missing.");
        }
        if(!gps.containsTag(GpsDirectory.TAG_GPS_LATITUDE_REF)){
           throw new MetadataException("GPS latitude reference missing.");
        }
        if(!gps.containsTag(GpsDirectory.TAG_GPS_LONGITUDE)){
           throw new MetadataException("GPS longitude missing.");
        }
        if(!gps.containsTag(GpsDirectory.TAG_GPS_LONGITUDE_REF)){
           throw new MetadataException("GPS longitude reference missing.");
        }
        result = new Wpt();
        result.setLat(
                    asBigDecimal(
                    gps.getRationalArray(GpsDirectory.TAG_GPS_LATITUDE),
View Full Code Here


    public void writeThumbnail(String filename) throws MetadataException, IOException
    {
        byte[] data = getThumbnailData();

        if (data==null)
            throw new MetadataException("No thumbnail data exists.");

        FileOutputStream stream = null;
        try {
            stream = new FileOutputStream(filename);
            stream.write(data);
View Full Code Here

                return "I";
            case 5:
                return "Q";
        }

        throw new MetadataException("Unsupported component id: " + _componentId);
    }
View Full Code Here

     * @return the 32 bit int value, between 0x0000 and 0xFFFF
     */
    private int get32Bits(int offset) throws MetadataException
    {
        if (offset+1>=_data.length) {
            throw new MetadataException("Attempt to read bytes from outside Jpeg segment data buffer");
        }

        return ((_data[offset] & 255) << 8) | (_data[offset + 1] & 255);
    }
View Full Code Here

     * @return the 16 bit int value, between 0x00 and 0xFF
     */
    private int get16Bits(int offset) throws MetadataException
    {
        if (offset>=_data.length) {
            throw new MetadataException("Attempt to read bytes from outside Jpeg segment data buffer");
        }

        return (_data[offset] & 255);
    }
View Full Code Here

    public String getComponentDataDescription(int componentNumber) throws MetadataException
    {
        JpegComponent component = ((JpegDirectory)_directory).getComponent(componentNumber);

        if (component==null)
            throw new MetadataException("No Jpeg component exists with number " + componentNumber);

        StringBuffer sb = new StringBuffer();
        sb.append(component.getComponentName());
        sb.append(" component: Quantization table ");
        sb.append(component.getQuantizationTableNumber());
View Full Code Here

            case 10: return SRATIONAL;
            case 11: return SINGLE;
            case 12: return DOUBLE;
        }

        throw new MetadataException("value '"+value+"' does not represent a known data format.");
    }
View Full Code Here

     * @return the 32 bit int value, between 0x0000 and 0xFFFF
     */
    private int get32Bits(int offset) throws MetadataException
    {
        if (offset >= _data.length) {
            throw new MetadataException("Attempt to read bytes from outside Iptc data buffer");
        }
        return ((_data[offset] & 255) << 8) | (_data[offset + 1] & 255);
    }
View Full Code Here

            case 10: return SRATIONAL;
            case 11: return SINGLE;
            case 12: return DOUBLE;
        }

        throw new MetadataException("value '"+value+"' does not represent a known data format.");
    }
View Full Code Here

    public void writeThumbnail(@NotNull String filename) throws MetadataException, IOException
    {
        byte[] data = _thumbnailData;

        if (data==null)
            throw new MetadataException("No thumbnail data exists.");

        FileOutputStream stream = null;
        try {
            stream = new FileOutputStream(filename);
            stream.write(data);
View Full Code Here

TOP

Related Classes of com.drew.metadata.MetadataException

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.