Create feature flags for more compression algorithms (#270)

This commit is contained in:
Jonathan Behrens authored and GitHub committed 2025-06-15 15:50:14 -07:00
1 parent dc2c67469b
commit 83e6d64751
8 files changed
+64 -15

No files matched your search

+4 -3
View File
@@ -3,7 +3,6 @@ use std::str;
use std::string;
use quick_error::quick_error;
use weezl::LzwError;
use crate::decoder::ChunkType;
use crate::tags::{
@@ -206,12 +205,14 @@ impl From<std::num::TryFromIntError> for TiffError {
}
}
impl From<LzwError> for TiffError {
fn from(err: LzwError) -> TiffError {
#[cfg(feature = "lzw")]
impl From<weezl::LzwError> for TiffError {
fn from(err: weezl::LzwError) -> TiffError {
TiffError::FormatError(TiffFormatError::CompressedDataCorrupt(err.to_string()))
}
}
#[cfg(feature = "jpeg")]
impl From<zune_jpeg::errors::DecodeErrors> for TiffError {
fn from(err: zune_jpeg::errors::DecodeErrors) -> Self {
TiffError::FormatError(TiffFormatError::CompressedDataCorrupt(err.to_string()))