All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.librawfx.dimension.AttributeDimensionProvider Maven / Gradle / Ivy

Go to download

This installs the native lib libraw as a JavaFX Image format provider similar to imageIO before on Swing

There is a newer version: 1.8.9
Show newest version
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.librawfx.dimension;

/**
 *
 * @author selfemp
 */
public class AttributeDimensionProvider implements DimensionProvider {

    private static final String HEIGHT = "height";
    private static final String WIDTH = "width";

    @Override
    public Dimension getDimension() {
        return new Dimension(getFloatAttribute(WIDTH), getFloatAttribute(HEIGHT));
    }

    private float getFloatAttribute(String name) {
        try {
            return Float.parseFloat(name);
        } catch (NumberFormatException e) {
            return 0;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy