我目前正在尝试使用 UIImagePickerController 在应用程序中拍摄照片,将它们保存到本地数据库并稍后将它们上传到服务。
但元数据(尤其是 EXIF)似乎并未自动与该图像捆绑在一起。我尝试像这样提取它:
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any])
{
self.imageDelegate?.saveImage( image: info[UIImagePickerControllerOriginalImage] as! UIImage, metadata: (info[UIImagePickerControllerMediaMetadata] as? NSDictionary)! )
// ...
}
Run Code Online (Sandbox Code Playgroud)
现在我应该拥有图像和元数据,但如何将其存储到 JPEG 文件中?我需要服务器上图像中的 GPS 数据。
我目前正在直接从相机胶卷中的 UImage 创建图像:
UIImageJPEGRepresentation(image,CGFloat(Constants.JPEG_QUALITY))
Run Code Online (Sandbox Code Playgroud)
这将被存储并上传。
我读过可能有使用“CGImageDestination”的可能性,但我不知道如何在我的情况下使用它们。
我无法在我的项目中安装 bcrypt 包。
我的朋友克隆了我项目的完全相同的存储库,它对他有用。
我红色了一些关于python或node-gyp的讨论的讨论,可能与这个问题有关。
我不知道它是否有帮助,但我有:
节点 v16.13.0
8.1.4
Mac M1、macOS 蒙特利版本 12.0.1
我也做了一个npm cache clean --force
我在尝试安装 bcrypt 5.0.1 时收到此消息:
yinkyflash@Air-de-Tom backend % npm install bcrypt
npm ERR! code 1
npm ERR! path /Users/yinkyflash/Desktop/Programming/OpenClassrooms/Projet 6/Livrables/TomCharmasson_6_27052021/backend/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR! LIBTOOL-STATIC Release/nothing.a
npm ERR! CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/yinkyflash/Desktop/Programming/OpenClassrooms/Projet 6/Livrables/TomCharmasson_6_27052021/backend/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/yinkyflash/Desktop/Programming/OpenClassrooms/Projet 6/Livrables/TomCharmasson_6_27052021/backend/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=8 …
Run Code Online (Sandbox Code Playgroud) 我必须安装 bcrypt,但遇到了错误。我尝试了我找到的大部分解决方案。有很多线程,但我在 Mac 上还没有看到很多。\n以下是我从终端得到的内容:
\nyarn install v1.22.11\nwarning ../../../package.json: No license field\ninfo No lockfile found.\n[1/5] Validating package.json...\n[2/5] Resolving packages...\nwarning @types/date-fns@2.6.0: This is a stub types definition for date-fns (https://github.com/date-fns/date-fns). date-fns provides its own type definitions, so you don't need @types/date-fns installed!\nwarning @types/knex@0.16.1: This is a stub types definition. knex provides its own type definitions, so you do not need this installed.\nwarning knex > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated\nwarning knex > liftoff > findup-sync …
Run Code Online (Sandbox Code Playgroud)