From ffc719bfc17700fe0af077ea58c99b710d458e92 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 31 May 2023 08:43:07 +1200 Subject: [PATCH] Add warnings about stripping APNGs --- src/main.rs | 2 +- src/png/mod.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 71c66fa3..c8cbc604 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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") diff --git a/src/png/mod.rs b/src/png/mod.rs index c2008098..6d41b434 100644 --- a/src/png/mod.rs +++ b/src/png/mod.rs @@ -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; @@ -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"); } } }