使用GhostSCript将BMP转换为其他文件图像类型

问题描述 投票:0回答:1

我有一个.bmp图像文件,当我从bitmap转换时总是返回错误:

gs -sDEVICE=png256 -o ./teste.png ./teste.bmp

返回:

GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in BM~
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   2045   1   3   %oparray_pop   2044   1   3   %oparray_pop   2025   1   3   %oparray_pop   1884   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:970/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Current file position is 5
GPL Ghostscript 9.26: Unrecoverable error, exit code 1

错误Error: /undefined in BM~随所有输出尝试一起返回

shell bitmap ghostscript bmp
1个回答
0
投票

Ghostscript不处理.bmp文件,它接受PDF或PostScript。您可以编写一个PostScript程序来放置.bmp图像(例如,参见viewgif.ps),但这根本不是一回事。

您需要一个图像处理应用程序,如上面的Mark Setchell所建议的ImageMagick。

© www.soinside.com 2019 - 2024. All rights reserved.