我试着用bash脚本和tiff2pdf把一堆可以上网的pdf弄得乱七八糟,但是我的测试套件遇到了一个非常奇怪的问题。当我ls -l..。
wmcduff@wmcduffscomp:~/Desktop/testdir$ ls -l
total 339896
-rw------- 1 joe joe 2165668 Feb 17 11:48 191611032571.pdf
-rw-rw-r-- 1 joe joe 28114948 Feb 17 11:51 1948010211.pdf
-rw------- 1 joe joe 28114113 Feb 17 11:42 1948010211.tif
-rw-rw-r-- 1 joe joe 29499021 Feb 17 11:51 1948010212.pdf
.
.
.但是,如果我identify -verbose 1948010211.pdf...
wmcduff@wmcduffscomp:~/Desktop/testdir$ identify -verbose 1948010211.pdf
Image: 1948010211.pdf
Format: PDF (Portable Document Format)
Class: DirectClass
Geometry: 1085x1456+0+0
Resolution: 72x72
Print size: 15.0694x20.2222
Units: Undefined
Type: PaletteAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 16/8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
.
.
.
Properties:
date:create: 2017-02-17T14:30:11-08:00
date:modify: 2017-02-17T14:30:11-08:00
pdf:HiResBoundingBox: 1085.04x1455.84+0+0
pdf:Version: PDF-1.1
signature: b3d978e3b2e7784867b27da677b7288e6674dfcaeb92a8c58f9faf19b20f0655
Profiles:
Profile-icc: 2576 bytes
Description: Artifex Software sRGB ICC Profile
Manufacturer: Artifex Software sRGB ICC Profile
Model: Artifex Software sRGB ICC Profile
Copyright: Copyright Artifex Software 2011
Artifacts:
filename: 1948010211.pdf
verbose: true
Tainted: True
Filesize: 2.395MB
Number pixels: 1.58M
Pixels per second: 39.49MB
User time: 0.040u
Elapsed time: 0:01.040
Version: ImageMagick 6.7.7-10 2016-11-29 Q16 http://www.imagemagick.org你知道为什么文件大小会有这么大的不同吗?我的bash脚本( tiff2pdf -u i -w 15.07 -l 20.22 -x 300 -y 300 -r o -o "${file/%.tif/.pdf}" "$file" )中创建这么大文件的命令是否有问题?
发布于 2017-02-20 23:21:41
您可能会认为在identify -verbose输出中观察到的Filesize具有误导性: it refers to the size of the BLOB使用了in memory,这与文件消耗的存储量不同。
除非需要identify -verbose命令生成的信息的其他部分,否则只需使用ls实用程序提供的文件大小即可。(或者,您可以使用另一个工具,如pdfinfo (Xpdf的一部分),或者甚至mdls,如果您使用的是Mac,这两个工具都会报告文件大小)。
https://stackoverflow.com/questions/42308570
复制相似问题