换主题缩略图,并把二进制文件锁进 .gitattributes
缩略图:原图是 2740x1424 的宽屏截图,主题缩略图要求 1200x900(4:3), 按中心裁切后缩放到 1200x900。裁掉的是左右各 421px。 另加 .gitattributes:本仓库 core.autocrlf=true,工作区 CRLF、仓库 LF。 这条规则对源码是对的,但二进制文件里天然含 0x0D 0x0A,一旦被当成文本 转换就当场损坏 —— PNG 会变成 file 判不出的 "data",getimagesize() 返回 false,WordPress 后台主题缩略图直接不显示。显式标 binary 后 git 不再动它们。 这次的损坏其实不是 git 干的,是打包脚本无差别 sed 's/\r$//' 造成的 (screenshot.png 少 3 个字节即 3 个 \r),脚本已同步修复。
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 271 KiB After Width: | Height: | Size: 764 KiB |
Reference in New Issue
Block a user