
我了解到pngcheck
我希望使用它来查找并突出显示可能损坏的 png 文件。
c:\pngcheck\pngcheck *.png
当我在包含文件的文件夹中运行命令时,我得到
*.png: Invalid argument
ERROR: *.png
我可能做错了什么?
答案1
pngcheck
Windows 不支持通配符。您需要循环运行它以对每个文件运行。CD 到您的图像目录,然后您就可以运行它了。将路径替换为您的位置。如果您不想 CD 到图像目录,pngcheck.win64.exe
您也可以用完整目录替换。即*.png
(c:\images\*.png)
for /r %i in (*.png) do "c:\pngcheck-3.0.3-win32\pngcheck.win64.exe" "%i"
如果您只运行"c:\pngcheck-3.0.3-win32\pngcheck.win64.exe"
,您就可以看到所有标志。
Options:
-7 print contents of tEXt chunks, escape chars >=128 (for 7-bit terminals)
-c colorize output (for ANSI terminals)
-p print contents of PLTE, tRNS, hIST, sPLT and PPLT (can be used with -q)
-q test quietly (output only errors)
-s search for PNGs within another file
-t print contents of tEXt chunks (can be used with -q)
-v test verbosely (print most chunk data)
-vv test very verbosely (decode & print line filters)
-w suppress windowBits test (a more-stringent compression check)
-x search for PNGs within another file and extract them when found
为了解决下面关于运行命令并仅将错误写入文件的评论,您可以使用标志-q
并将数据附加到文件中>> errors.txt
for /r %i in (*.png) do "c:\pngcheck-3.0.3-win32\pngcheck.win64.exe" -q "%i" >> errors.txt