gpt4 book ai didi

hugo - 如何从原始图像中剥离 exif

转载 作者:行者123 更新时间:2023-12-05 06:14:07 27 4
gpt4 key购买 nike

我喜欢遵循此处描述的简码约定:https://laurakalbag.com/processing-responsive-images-with-hugo/并像这样在 config.toml 中设置 exif 参数

[imaging.exif]
# Regexp matching the fields you want to Exclude from the (massive) set of Exif info
# available. As we cache this info to disk, this is for performance and
# disk space reasons more than anything.
# If you want it all, put ".*" in this config setting.
# Note that if neither this or ExcludeFields is set, Hugo will return a small
# default set.
includeFields = ""

# Regexp matching the Exif fields you want to exclude. This may be easier to use
# than IncludeFields above, depending on what you want.
excludeFields = ".*"

# Hugo extracts the "photo taken" date/time into .Date by default.
# Set this to true to turn it off.
disableDate = true

# Hugo extracts the "photo taken where" (GPS latitude and longitude) into
# .Long and .Lat. Set this to true to turn it off.
disableLatLong = true

但是,我注意到虽然 hugo 正确地从生成的缩放图像中去除了 exif,但 hugo 还将具有完整 EXIF 的原始图像放在公共(public)目录中,这会带来安全问题。

我很满意不发布原始图像的解决方案,或者发布原始图像但带有剥离 EXIF 的解决方案。

感谢您的指点,我确信我误解了一些基本的东西!

最佳答案

有点不雅,但非常安全的是在实际构建之前调用某种准备(到/public)。这样您就可以自动删除所有照片中的所有 EXIF 信息(例如在博客目录中)。为此,我使用“jhead”。我将此命令和其他准备工作与构建一起包含在脚本中。如果您没有自己的构建过程,那么这当然行不通。

find ./static/images/ -type f | xargs -i jhead -purejpg {}

关于hugo - 如何从原始图像中剥离 exif,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63027389/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com