ExifTool:删除图像的所有元数据,Java 应用程序中的元数据除外

斯内哈·辛哈

我想删除除“版权”之外的所有图像元数据。我正在使用这个的 exiftool。这个命令是“exiftool -all= -tagsFromFile @ -copyright Tunis_Bab_Souika_1899.jpg”。但是当我在 java 应用程序中执行此操作时.它以某种方式删除了所有标签。

这是代码片段-

    val outputConsumer = ArrayListOutputConsumer()
    val exiftoolCmd = ExiftoolCmd()
    exiftoolCmd.setOutputConsumer(outputConsumer)
    val operation = ETOperation()
    println("File name" + sourceImage.toFile().absolutePath)
    operation.addImage(sourceImage.toFile().absolutePath)
    // exiftool -all= -tagsFromFile @ -copyright Tunis_Bab_Souika_1899.jpg
    operation.addRawArgs("-all=")
    operation.addRawArgs("-tagsFromFile @")
    operation.addRawArgs("-copyright")

    println("About to execute")
    try {exiftoolCmd.run(operation)
        println("Inside try")
    } catch (e: java.lang.Exception) {
        throw RuntimeException(e)
    }
    val output = outputConsumer.output
        .stream()
        .map { obj: String -> obj.trim { it <= ' ' } }
        .collect(toList())
    println("ooutput$output")
斯内哈·辛哈

回答我的问题 - 这对我有用 -

 operation.delTags("all")
            operation.tagsFromFile("@")
            operation.getTags("copyright")
            operation.addImage(sourceImage.toFile().absolutePath)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

ExifTool:删除除特定标签外的所有元数据

应用程序在元数据中包含对Android的引用

ExifTool-如何从文件夹及其所有子文件夹内的所有文件中删除所有元数据?

由于(违反元数据政策)从 Google Play 商店中删除应用程序

在命令行上从图像中删除所有元数据

如何在Spring Boot应用程序中读取和存储APK元数据

ffmpeg的元数据在电子应用程序中未定义

应用程序的AndroidManifest.xml中的元数据标记的值不正确。- 谷歌地图

搜索元数据的应用程序的体系结构

如何从Java中的JPEG图像中删除元数据?

使用python从excel中删除所有元数据

读取时删除图像中的元数据?

在Django South中删除外部应用程序迁移

如何显示有关图像的所有元数据?

PLA 1.2与您的应用程序关联的卖方和公司名称未按要求在应用程序或其元数据中反映名称“ Lumique”

使用ExifTool读取元数据

AWS应用程序的春季启动启动错误:没有可用的EC2元数据

Flutter:应用程序的AndroidManifest.xml中的位置包错误元数据标记不存在

如何在Rails 4应用程序中设置“ application / ld + json” schema.org元数据

Flask 应用程序中的内存数据

我可以从 google-services.json 文件中安全地删除除当前应用程序数据之外的所有应用程序数据吗?

如何生成 Java Spring 应用程序的元数据文件以与身份提供程序(如 Ping Federate)建立连接?

有没有办法让Exiftool递归扫描文件中嵌入的文件的元数据?

如何从应用程序中删除数据库?

预订应用程序中的客户重复数据删除

删除应用程序中的领域数据WillTerminate

如何从 Azure 应用程序洞察中删除数据

如何从iOS应用程序中删除保存数据

从 Web 应用程序中删除 Firebase 数据