macos OS X:创建或提取 .eps 文件的预览(.jpg、.png)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/401971/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 05:59:51  来源:igfitidea点击:

OS X: creating or extracting preview(.jpg,.png) of .eps file

macoscommand-line

提问by Ronn

I'm using a mac and looking to batch convert a large amount of eps files and create jpg previews of each. I'm looking for preferably a command-line utility, or some type of workflow to easily batch a large number of files.

我正在使用 Mac 并希望批量转换大量 eps 文件并为每个文件创建 jpg 预览。我正在寻找最好的命令行实用程序,或某种类型的工作流来轻松批处理大量文件。

Thanks for any ideas or input

感谢您的任何想法或意见

回答by Sophie Alpert

Like codelogic mentioned, sipsis a good tool for this. However, it doesn't support EPS natively, so you need to convert to PDF first.

就像提到的 codelogic 一样,这sips是一个很好的工具。但是,它本身不支持EPS,因此您需要先转换为PDF。

If you're on Tiger or Leopard, something like the following should work:

如果您使用 Tiger 或 Leopard,则应该可以使用以下内容:

mkdir pdf jpg

cd pdf
echo ../eps/*.eps | xargs -n1 pstopdf
cd ..


sips -s format jpeg *.pdf --out jpg/

Assuming your EPS files are in the current directory, this will first convert them all to pdf, storing them in the pdf/ directory, then convert each PDF to a JPEG file in the jpg/ directory.

假设您的 EPS 文件在当前目录中,这将首先将它们全部转换为 pdf,将它们存储在 pdf/ 目录中,然后将每个 PDF 转换为 jpg/ 目录中的 JPEG 文件。

回答by Adam Rosenfield

ImageMagickshould be exactly what you're looking for. Once you have it installed, just use the convertutility:

ImageMagick应该正是您正在寻找的。安装后,只需使用该convert实用程序:

convert file.eps -resize 25% preview.jpg  # create jpg thumbnail at 25% size

回答by codelogic

On OS X, you can use sipsto perform image processing tasks, like thumbnailing. It should support EPS. If it doesn't, as Adam recommended there is ImageMagick's convert.

在 OS X 上,您可以使用sips来执行图像处理任务,例如缩略图。它应该支持EPS。如果没有,正如亚当推荐的那样,有 ImageMagick 的convert.

回答by CW CW

sips works fine in for me if I drop the trailing '/', i.e. output to jpeg rather than jpeg/

如果我删除尾随的“/”,即输出到 jpeg 而不是 jpeg/,sips 对我来说很好用