hul*_*ist 16 shotwell thumbnails
由于某种未知原因,我的 Shotwell 中的所有缩略图都丢失了,而是所有图标都是灰色的。图像本身一切正常,我可以在 Shotwell 中打开它们。
只有空文件夹,.shotwell/thumbs/所以看起来缩略图根本没有生成。
我还尝试重新安装 Shotwell(通过先清除它)而不做任何更改。
如何让 Shotwell 重新生成所有缩略图?
小智 15
此 shell 脚本将重新生成大小为 128px 和 360px 的缩略图,因此您至少会在查看器中看到一些内容。
sqlite3 ~/.local/share/shotwell/data/photo.db \
"select id||' '||filename from PhotoTable order by timestamp desc" |
while read id filename; do
for size in 128 360; do
tf=$(printf ~/.cache/shotwell/thumbs/thumbs${size}/thumb%016x.jpg $id);
test -e "$tf" || {
echo -n "Generating thumb for $filename ($tf)";
convert "$filename" -auto-orient -thumbnail ${size}x${size} $tf
echo
}
done
done
Run Code Online (Sandbox Code Playgroud)
小智 7
Shotwell 重新生成缩略图的简单方法(这是一种解决方法):
这将强制 Shotwell 重新生成所有照片并尊重它为它们存储的任何转换。
正如 phq 所提到的,有一个突出的错误可以解决此问题,因此您不需要此解决方法。在此之前,这是解决此问题的推荐方法。上面发布的脚本不支持转换,这意味着您的缩略图可能看起来不像您在 Shotwell 中的照片。
小智 5
我只是使用了这个答案中给出的shell 脚本,但我有大约 22000 个缩略图要生成。
所以这是这个脚本的 bash 版本,使用~/.shotwell而不是~/.local/shotwell(这是我拥有的)并使用与我的处理器一样多的内核(在我的情况下快 8 倍!):
#!/bin/bash
# under linux, use this to launch as many convert as your processor core number
#MAX_PROCESSES=`cat /proc/cpuinfo |grep ^processor | wc -l`
# or use a static value
MAX_PROCESSES=4
sqlite3 ~/.shotwell/data/photo.db "select id||' '||filename from PhotoTable order by timestamp desc" |
while read id filename; do
for size in 128 360; do
tf=$(printf ~/.shotwell/thumbs/thumbs${size}/thumb%016x.jpg $id);
test -e "$tf" || {
echo "Generating thumb for $filename ($tf)";
convert "$filename" -auto-orient -thumbnail ${size}x${size} $tf &
RUNNING="`jobs -p |wc -l`"
while [ "$RUNNING" -ge "$MAX_PROCESSES" ]
do
sleep 0.3
RUNNING="`jobs -p |wc -l`"
done
}
done
done
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6097 次 |
| 最近记录: |