Skip to contents

TIFF files contain metadata about images in their TIFF tags. This function is for reading this information without reading the actual image.

Usage

read_tags(path, frames = 1)

tags_read(path, frames = 1)

Arguments

path

A string. The path to the tiff file to read.

frames

Which frames do you want to read tags from. Default first frame only. To read from the 2nd and 7th frames, use frames = c(2, 7), to read from all frames, use frames = "all".

Value

A list of lists.

See also

Author

Simon Urbanek, Kent Johnson, Rory Nolan.

Examples

read_tags(system.file("img", "Rlogo.tif", package = "ijtiff"))
#> $frame1
#> $frame1$width
#> [1] 100
#> 
#> $frame1$length
#> [1] 76
#> 
#> $frame1$bits_per_sample
#> [1] 8
#> 
#> $frame1$samples_per_pixel
#> [1] 4
#> 
#> $frame1$sample_format
#> [1] "uint"
#> 
#> $frame1$planar_config
#> [1] "contiguous"
#> 
#> $frame1$rows_per_strip
#> [1] 76
#> 
#> $frame1$compression
#> [1] "LZW"
#> 
#> $frame1$x_resolution
#> [1] 299.99
#> 
#> $frame1$y_resolution
#> [1] 299.99
#> 
#> $frame1$resolution_unit
#> [1] "inch"
#> 
#> $frame1$orientation
#> [1] "top_left"
#> 
#> $frame1$color_space
#> [1] "RGB"
#> 
#> 
read_tags(system.file("img", "Rlogo-banana.tif", package = "ijtiff"),
  frames = c(2, 4)
)
#> $frame2
#> $frame2$width
#> [1] 100
#> 
#> $frame2$length
#> [1] 78
#> 
#> $frame2$bits_per_sample
#> [1] 8
#> 
#> $frame2$samples_per_pixel
#> [1] 3
#> 
#> $frame2$sample_format
#> [1] "uint"
#> 
#> $frame2$planar_config
#> [1] "contiguous"
#> 
#> $frame2$rows_per_strip
#> [1] 78
#> 
#> $frame2$compression
#> [1] "deflate"
#> 
#> $frame2$software
#> [1] "ijtiff package, R 4.0.0"
#> 
#> $frame2$color_space
#> [1] "black is zero"
#> 
#> 
#> $frame4
#> $frame4$width
#> [1] 100
#> 
#> $frame4$length
#> [1] 78
#> 
#> $frame4$bits_per_sample
#> [1] 8
#> 
#> $frame4$samples_per_pixel
#> [1] 3
#> 
#> $frame4$sample_format
#> [1] "uint"
#> 
#> $frame4$planar_config
#> [1] "contiguous"
#> 
#> $frame4$rows_per_strip
#> [1] 78
#> 
#> $frame4$compression
#> [1] "deflate"
#> 
#> $frame4$software
#> [1] "ijtiff package, R 4.0.0"
#> 
#> $frame4$color_space
#> [1] "black is zero"
#> 
#>