使用 Lua 脚本将图片保存到 iOS 照片库

我使用以下 Lua 脚本从图片路径下载图像 "image1.png"。但是我检查照片文件夹时,照片没有显示。

-- 检索 URL 的内容
http = require("socket.http")
body, code = http.request("https://thispersondoesnotexist.com/image")
if not body then error(code) end

-- 将内容保存到文件中
f = assert(io.open("/var/mobile/Media/DCIM/100APPLE/image.jpg", "wb"))
-- 以“二进制”模式打开
f:write(body)
f:close()

如何将该照片转换为照片呢?

原文链接 https://stackoverflow.com/questions/70470729

点赞