首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Imagemagick识别与ls -l截然不同的-verbose reporting文件大小

Imagemagick识别与ls -l截然不同的-verbose reporting文件大小
EN

Stack Overflow用户
提问于 2017-02-18 06:37:48
回答 1查看 235关注 0票数 2

我试着用bash脚本和tiff2pdf把一堆可以上网的pdf弄得乱七八糟,但是我的测试套件遇到了一个非常奇怪的问题。当我ls -l..。

代码语言:javascript
复制
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...

代码语言:javascript
复制
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" )中创建这么大文件的命令是否有问题?

EN

回答 1

Stack Overflow用户

发布于 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,这两个工具都会报告文件大小)。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42308570

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档