转换图像扩展名

发布于 2024-09-28 09:19:12 字数 155 浏览 11 评论 0原文

您好,需要帮助创建一个脚本,将 tif 图像的扩展名转换为 .png 并从文件中删除原始图像。

这就是我所拥有的。 @回声关闭 图像1.tif>> image1.png

运行时将其显示为 .png 但带有空白图像。仍然不知道如何从文件夹中删除原始的。

Hi need help creating a script to convert the extension of a tif image to a .png and removing the original from the file.

This is what I have.
@echo off
image1.tif >> image1.png

when it run it show it as a .png but with a blank image. Still haven't figure out how to remove the original one from the folder.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝戈者 2024-10-05 09:19:12

嗯,假设 @echo off 之后应该有一个换行符:您正在做的是将运行文件 image1.tif 的进程的输出流附加到文件 image1.png (创建它如果它不存在)。由于打开 image1.tif 的程序不会向标准输出流写入任何内容,因此会创建另一个文件,但它是空的。看来您想要做的事情(无论原因是什么)是将 image1.tif 重命名为 image1.png:

ren image1.tif image1.png

或复制它:

copy image1.tif image1.png

Humm, assuming that there should be a newline after @echo off: What you're doing is appending the output stream from the process running the file image1.tif, to a file image1.png (creating it if it doesn't exist). As the program that opens up image1.tif doesn't write anything to the standard output stream, the other file gets created but is empty. It seems that what you want to be doing (whatever the reason is) is renaming image1.tif to image1.png:

ren image1.tif image1.png

or copy it:

copy image1.tif image1.png
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文