Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove debug printf statements. #1257

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions libheif/codecs/uncompressed_image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,27 @@ static Error uncompressed_image_type_is_supported(std::shared_ptr<Box_uncC>& unc
uint16_t component_index = component.component_index;
uint16_t component_type = cmpd->get_components()[component_index].component_type;
if ((component_type > 7) && (component_type != component_type_padded)) {
printf("unsupported component type: %d\n", component_type);
std::stringstream sstr;
sstr << "Uncompressed image with component_type " << ((int) component_type) << " is not implemented yet";
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
sstr.str());
}
if ((component.component_bit_depth > 8) && (component.component_bit_depth != 16)) {
printf("unsupported component bit depth for index: %d, value: %d\n", component_index, component.component_bit_depth);
std::stringstream sstr;
sstr << "Uncompressed image with component_bit_depth " << ((int) component.component_bit_depth) << " is not implemented yet";
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
sstr.str());
}
if (component.component_format != component_format_unsigned) {
printf("unsupported component format\n");
std::stringstream sstr;
sstr << "Uncompressed image with component_format " << ((int) component.component_format) << " is not implemented yet";
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
sstr.str());
}
if (component.component_align_size > 2) {
printf("unsupported component_align_size\n");
std::stringstream sstr;
sstr << "Uncompressed image with component_align_size " << ((int) component.component_align_size) << " is not implemented yet";
return Error(heif_error_Unsupported_feature,
Expand All @@ -93,7 +89,6 @@ static Error uncompressed_image_type_is_supported(std::shared_ptr<Box_uncC>& unc
&& (uncC->get_sampling_type() != sampling_mode_422)
&& (uncC->get_sampling_type() != sampling_mode_420)
) {
printf("bad sampling: %d\n", uncC->get_sampling_type());
std::stringstream sstr;
sstr << "Uncompressed sampling_type of " << ((int) uncC->get_sampling_type()) << " is not implemented yet";
return Error(heif_error_Unsupported_feature,
Expand All @@ -106,7 +101,6 @@ static Error uncompressed_image_type_is_supported(std::shared_ptr<Box_uncC>& unc
&& (uncC->get_interleave_type() != interleave_mode_row)
&& (uncC->get_interleave_type() != interleave_mode_tile_component)
) {
printf("bad interleave: %d\n", uncC->get_interleave_type());
std::stringstream sstr;
sstr << "Uncompressed interleave_type of " << ((int) uncC->get_interleave_type()) << " is not implemented yet";
return Error(heif_error_Unsupported_feature,
Expand Down Expand Up @@ -198,33 +192,28 @@ static Error uncompressed_image_type_is_supported(std::shared_ptr<Box_uncC>& unc
// TODO: throw error if mixed and Cb and Cr are not adjacent.

if (uncC->get_block_size() != 0) {
printf("unsupported block size\n");
std::stringstream sstr;
sstr << "Uncompressed block_size of " << ((int) uncC->get_block_size()) << " is not implemented yet";
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
sstr.str());
}
if (uncC->is_components_little_endian()) {
printf("unsupported components LE\n");
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
"Uncompressed components_little_endian == 1 is not implemented yet");
}
if (uncC->is_block_pad_lsb()) {
printf("unsupported block pad LSB\n");
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
"Uncompressed block_pad_lsb == 1 is not implemented yet");
}
if (uncC->is_block_little_endian()) {
printf("unsupported block LE\n");
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
"Uncompressed block_little_endian == 1 is not implemented yet");
}
if (uncC->is_block_reversed()) {
printf("unsupported block reversed\n");
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
"Uncompressed block_reversed == 1 is not implemented yet");
Expand Down Expand Up @@ -300,13 +289,11 @@ Error UncompressedImageCodec::get_heif_chroma_uncompressed(std::shared_ptr<Box_u
// TODO: more combinations

if (*out_chroma == heif_chroma_undefined) {
printf("unknown chroma\n");
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
"Could not determine chroma");
}
else if (*out_colourspace == heif_colorspace_undefined) {
printf("unknown colourspace\n");
return Error(heif_error_Unsupported_feature,
heif_suberror_Unsupported_data_version,
"Could not determine colourspace");
Expand Down Expand Up @@ -493,7 +480,6 @@ static bool map_uncompressed_component_to_channel(const std::shared_ptr<Box_cmpd
case component_type_padded:
return false;
default:
printf("unmapped component_type: %d\n", component_type);
return false;
}
}
Expand Down Expand Up @@ -921,7 +907,6 @@ Error UncompressedImageCodec::decode_uncompressed_image(const HeifContext* conte
std::vector<std::shared_ptr<Box>> item_properties;
Error error = context->get_heif_file()->get_properties(ID, item_properties);
if (error) {
printf("failed to get properties\n");
return error;
}

Expand Down Expand Up @@ -990,7 +975,6 @@ Error UncompressedImageCodec::decode_uncompressed_image(const HeifContext* conte

error = uncompressed_image_type_is_supported(uncC, cmpd);
if (error) {
printf("unsupported image type\n");
return error;
}

Expand All @@ -999,7 +983,6 @@ Error UncompressedImageCodec::decode_uncompressed_image(const HeifContext* conte
heif_colorspace colourspace;
error = get_heif_chroma_uncompressed(uncC, cmpd, &chroma, &colourspace);
if (error) {
printf("failed to get chroma uncompressed\n");
return error;
}
img->create(width, height,
Expand All @@ -1023,7 +1006,6 @@ Error UncompressedImageCodec::decode_uncompressed_image(const HeifContext* conte
delete decoder;
return result;
} else {
printf("bad interleave mode - we should have detected this earlier: %d\n", uncC->get_interleave_type());
std::stringstream sstr;
sstr << "Uncompressed interleave_type of " << ((int) uncC->get_interleave_type()) << " is not implemented yet";
return Error(heif_error_Unsupported_feature,
Expand Down
Loading