Skip to content

Commit

Permalink
Add warnings about stripping APNGs
Browse files Browse the repository at this point in the history
  • Loading branch information
andrews05 committed May 30, 2023
1 parent e1e7a17 commit ffc719b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ fn main() {
)
.arg(
Arg::new("strip")
.help("Strip metadata objects ['safe', 'all', or comma-separated list]")
.help("Strip metadata objects ['safe', 'all', or comma-separated list]\nCAUTION: stripping 'all' will convert APNGs to standard PNGs")
.long("strip")
.takes_value(true)
.value_name("mode")
Expand Down
3 changes: 3 additions & 0 deletions src/png/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::interlace::{deinterlace_image, interlace_image, Interlacing};
use crate::Options;
use bitvec::bitarr;
use libdeflater::{CompressionLvl, Compressor};
use log::warn;
use rgb::ComponentSlice;
use rustc_hash::FxHashMap;
use std::fs::File;
Expand Down Expand Up @@ -112,6 +113,8 @@ impl PngData {
name: chunk.name,
data: chunk.data.to_owned(),
})
} else if chunk.name == *b"acTL" {
warn!("Stripping animation data from APNG - image will become standard PNG");
}
}
}
Expand Down

0 comments on commit ffc719b

Please sign in to comment.