extract_thumbnail

Function extract_thumbnail 

Source
pub fn extract_thumbnail<P: AsRef<Path>>(path: P) -> Result<Vec<u8>, RawError>
Expand description

Convenience function to extract thumbnail from a RAW file path

This is a shorthand for RawProcessor::extract_thumbnail(path)

§Arguments

  • path - Path to the RAW file

§Returns

Returns the thumbnail image data as a byte vector (typically JPEG format)

§Example

use rawlib::extract_thumbnail;
 
let thumb_bytes = extract_thumbnail("photo.cr2").unwrap();
std::fs::write("thumbnail.jpg", &thumb_bytes).unwrap();