Skip to content

Commit

Permalink
Alpha image size can be different from the primary one.
Browse files Browse the repository at this point in the history
  • Loading branch information
ledyba-z committed Mar 3, 2020
1 parent 87ce410 commit 0b3bbc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,17 @@ int _main(int argc, char** argv) {
unsigned int elapsed = decodeImageAt(log, res, alphaID.value(), ctx, alphaImg.value());
log.info(" Decoded: %s -> %s in %d [ms] (Alpha image)", inputFilename, outputFilename, elapsed);
if(alphaImg.value().p.w != primaryImg.p.w || alphaImg.value().p.h != primaryImg.p.h) {
// TODO(ledyba-z): Can alpha image and primary image be different size?
// TODO(ledyba-z): It is okay to alpha image and primary image are different sizes.
// see: https://github.com/AOMediaCodec/av1-avif/issues/68
log.fatal("Alpha size (%d x %d) does not match to primary image(%d x %d).",
log.fatal("Currently, alpha image whose size (%d x %d) does not match to primary image (%d x %d) is not supported.",
alphaImg.value().p.w, alphaImg.value().p.h, primaryImg.p.w, primaryImg.p.h);
}
if(outputAlphaFilename.has_value()) {
std::optional<Dav1dPicture> empty{};
saveImage(log, outputAlphaFilename.value(), fileBox, alphaImg.value(), empty);
log.info(" Extracted: %s -> %s (Alpha image)", inputFilename, outputAlphaFilename.value());
}
}else{
} else {
if(outputAlphaFilename.has_value()) {
log.fatal("%s does not have alpha plane.", inputFilename);
}
Expand Down

0 comments on commit 0b3bbc7

Please sign in to comment.