Closed Yay295 closed 6 months ago
@Yay295 oxipng currently errors for chunk names that aren't 4 characters:
% oxipng -P --strip eXIff image.png
Invalid chunk name eXIff
As per @andrews05 - the 4 letter length check works correctly for me. I would suggest any further checks (case-sensitive, etc.) are going to cause issues for those doing more experimental work; it's an unnecessary complication.
huh, somehow I didn't see that error message yesterday. I guess I must have ran the wrong command when I was testing it.
OxiPNG also requires PNG chunk header names to be exactly 4 bytes long during parsing. Personally, I find strict case validation somewhat constraining, especially for those involved with PNG format internals. Therefore, I believe there's no need for additional validations in this regard.
I'll go ahead and close this issue. Please feel free to open another if you have any new ideas to discuss, or leave a comment here if there's anything specific related to chunk names that you'd like to add :+1:
Per the PNG specification, chunk names are four characters long. It would be useful to have a warning if an invalid name is entered.
It might also be useful to have a warning if a valid chunk name is entered but it has the wrong capitalization: ex. "exif" vs "eXIf". Since you can technically add any chunk you want to an image, and chunk names are case-sensitive, this would only be useful for the chunks defined in the specification, but I imagine that would be all most people need. As an extra feature, this warning could be silenced if you enter the same name with the same capitalization twice, as confirmation that you really did mean to use that capitalization.