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

Wrong error message about color type #217

Closed
ledyba-z opened this issue Apr 14, 2022 · 0 comments · Fixed by #218
Closed

Wrong error message about color type #217

ledyba-z opened this issue Apr 14, 2022 · 0 comments · Fixed by #218
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ledyba-z
Copy link
Contributor

switch(colorType) {
case PNG_COLOR_TYPE_GRAY:
pixelOrder = avif::img::PixelOrder::Mono;
break;
case PNG_COLOR_TYPE_RGB:
case PNG_COLOR_TYPE_PALETTE:
pixelOrder = avif::img::PixelOrder::RGB;
break;
case PNG_COLOR_TYPE_GRAY_ALPHA:
pixelOrder = avif::img::PixelOrder::MonoA;
break;
case PNG_COLOR_TYPE_RGB_ALPHA:
pixelOrder = avif::img::PixelOrder::RGBA;
break;
default:
throw std::logic_error(fmt::format("Unknown bit depth: {}", bitDepth));
}

This code checks about color type, not bit-depth.

@ledyba-z ledyba-z added bug Something isn't working good first issue Good for newcomers labels Apr 14, 2022
@ledyba-z ledyba-z changed the title Wrong error message Wrong error message about color type Apr 14, 2022
ledyba-z added a commit that referenced this issue Apr 15, 2022
Fixed wrong error message about color type. [Issue #217]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants