- 作者帖子
tigershuai游客未曾先生,有这样一类图,横向(x轴)图块名为00000000000051200512.jpg、00000005120051200512.jpg、00000010240051200512.jpg、00000015360051200512.jpg.......,纵向(y轴)图块名为00000000000051200512.jpg、00512000000051200512.jpg、0102400000051200512.jpg、01536000000051200512.jpg.......,最后一个图块名为17408209920051200512.jpg,每个图块的大小为512x512。从以上看出,图块的命名规则为(x)(y)0051200512,x、y分别从00000开始,每次递进512,以此类推。
请未曾先生指点,类似这样的图怎么编码用dezoomify-rs下载?
tigershuai游客
tigershuai游客再次拜求
张飞白游客看了一下这张图碎片的拼接规律,应该如你所说那样
dezoomify-rs应该不能自动拼接下载大图,毕竟这种编码方式比较少见,不属于dezoomify-rs常见的那几种
如果确实要下载,可能要针对这个网站专门写下载器,可能会略麻烦
tigershuai游客@张飞白 #37293
编码如下:
url_template: "http://mahoroba.lib.nara-wu.ac.jp/y29/taimanerikuyouzu/resources/tanjoji_taimanerikuyouzu/0/{{x}}{{y}}0051200512.jpg"
variables:
- { name: x, from: 0, to: 16896, step: 512 } # Image width, in pixels
- { name: y, from: 0, to: 20480, step: 512 } # Image height, in pixels出现如下错误:
分析是这个代码图块命名有问题,但类似数字前加0的图块名不知怎么编码,如果能解决这个问题,那下载应该就没问题了,求教高人解决此问题。
未曾管理员@tigershuai #36845
用tiles.yaml不太好定义
我用bash写的可以,拼图链接如下
清海曼荼罗.圣光寺所藏.12683x15252像素.室町时代
nx.shuge.org/wl/?i...6zWi7QtGPUbash脚本大致如下(linux环境需要安装imagemagick)
图片会保存到jpgout目录下
#!/bin/bash # Script to download tiles # Last update: 20220221 bid="shoukou_seikai" dzi='https://www.nara-wu.ac.jp/aic/gdb/mahoroba/y15/seikai/resources/'$bid'/root.xml' xml=
curl -s ''$dzi''
wi=(echo $xml | sed 's/.*width=\"\([0-9]*\).*/\1/g'
) hi=(echo $xml | sed 's/.*height=\"\([0-9]*\).*/\1/g'
) url='https://www.nara-wu.ac.jp/aic/gdb/mahoroba/y15/seikai/resources/'$bid'/0/' cols=$((wi/256+1)) rows=$((hi/256+1)) for ((i = 0; i < $rows; i++)) do string='' for ((j = 0; j < $cols; j++)) do if [ $i -lt $((rows-1)) ] ; then nh=256 else nh=$((hi%256)) fi if [ $j -lt $((cols-1)) ] ; then nw=256 else nw=$((wi%256)) fi num1=echo $((j*256))|awk '{printf("%05d\n",$0)}'
num2=echo $((i*256))|awk '{printf("%05d\n",$0)}'
num3=echo $nw |awk '{printf("%05d\n",$0)}'
num4=echo $nh |awk '{printf("%05d\n",$0)}'
image=$num1$num2$num3$num4'.jpg' img=$j'_'$i'.jpg' file=$url$image string=$string' '$img wget --no-check-certificate --user-agent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16" -c -t 40 -O $img $file -q done montage $string -tile $cols''x1 -mode concatenate row$i.jpg done string='' for ((i = 0; i<$rows; i++)) do string=$string' 'row$i.jpg done folder="jpgout" if [ ! -d "$folder" ]; then mkdir "$folder" fi convert -limit memory 0 -strip +profile "*" -quality 85 $string -append -density 300 -units PixelsPerInch jpgout/$bid.jpg string=*.jpg rm $string
tigershuai游客@未曾 #37583
请问未曾先生,这个脚本怎么运行呢?
未曾管理员@tigershuai #37586
Linu环境下运行
- 作者帖子
正在查看 8 个帖子:1-8 (共 8 个帖子)
正在查看 8 个帖子:1-8 (共 8 个帖子)
正在查看 8 个帖子:1-8 (共 8 个帖子)