本文整理汇总了Java中com.drew.metadata.Directory.getRational方法的典型用法代码示例。如果您正苦于以下问题:Java Directory.getRational方法的具体用法?Java Directory.getRational怎么用?Java Directory.getRational使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.drew.metadata.Directory
的用法示例。
在下文中一共展示了Directory.getRational方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testThumbnailXResolution
import com.drew.metadata.Directory; //导入方法依赖的package包/类
@Test
public void testThumbnailXResolution() throws Exception
{
Directory directory = readDirectoryFromJpegFile("Tests/com/drew/metadata/exif/manuallyAddedThumbnail.jpg", ExifThumbnailDirectory.class);
Rational rational = directory.getRational(ExifThumbnailDirectory.TAG_X_RESOLUTION);
Assert.assertNotNull(rational);
Assert.assertEquals(72, rational.getNumerator());
Assert.assertEquals(1, rational.getDenominator());
}
示例2: testThumbnailYResolution
import com.drew.metadata.Directory; //导入方法依赖的package包/类
@Test
public void testThumbnailYResolution() throws Exception
{
Directory directory = readDirectoryFromJpegFile("Tests/com/drew/metadata/exif/manuallyAddedThumbnail.jpg", ExifThumbnailDirectory.class);
Rational rational = directory.getRational(ExifThumbnailDirectory.TAG_Y_RESOLUTION);
Assert.assertNotNull(rational);
Assert.assertEquals(72, rational.getNumerator());
Assert.assertEquals(1, rational.getDenominator());
}
示例3: testXResolution
import com.drew.metadata.Directory; //导入方法依赖的package包/类
public void testXResolution() throws Exception
{
String fileName = "Source/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());
}
示例4: testYResolution
import com.drew.metadata.Directory; //导入方法依赖的package包/类
public void testYResolution() throws Exception
{
String fileName = "Source/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());
}