在 Xcode 中工作:找不到 exiftool:找不到 Image/ExifTool.pm

发布于 2024-10-27 04:30:43 字数 2089 浏览 6 评论 0原文

但它就在那里。

在此处输入图像描述

有什么想法吗?

当我尝试从图像文件(这是运行 shell 脚本的 AppleScript)获取元数据时,会发生这种情况:

on getMetaData(filePath)
-->get meta data
try
    set myCommand to (quoted form of (POSIX path of (pathToExifTool)) & " " & quoted form of (POSIX path of (filePath)))
    set thisMetaData to (do shell script myCommand)
on error errMsg
    log "Can't find exiftool:" & errMsg
end try
...

pathToExifTool 是这样的:

/Users/steve/Desktop/XCodeApps/ImageArchiveDeluxeX/build/Release/ImageArchiveDeluxeX.app/Contents/Resources/ exiftool”

并且存在。

这是抛出的完整错误:

“找不到 exiftool:无法在 @INC 中定位 Image/ExifTool.pm (@INC 包含:/Users/steve/Desktop/XCodeApps/ImageArchiveDeluxeX/build/Release/ ImageArchiveDeluxeX.app/Contents/Resources/lib /Library/Perl/Updates/5.8.8 /System/Library/Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /Library/ Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/ 5.8.8 /网络/库/Perl /系统/库/Perl/Extras/5.8.8/darwin-thread-multi-2level /系统/库/Perl/Extras/5.8.8 /库/Perl/5.8.6 / Library/Perl/5.8.1 .) 位于 /Users/steve/Desktop/XCodeApps/ImageArchiveDeluxeX/build/Release/ImageArchiveDeluxeX.app/Contents/Resources/exiftool 第 30 行。 BEGIN 失败 - 编译在 /Users/steve/Desktop/XCodeApps/ImageArchiveDeluxeX/build/Release/ImageArchiveDeluxeX.app/Contents/Resources/exiftool 第 30 行中止。”

好吧,捆绑包一团糟(很多 .pm 文件漂浮在 - >image-->ExifTool.pm 路径在那里。

它们看起来是重复的)但是 exiftool -- 这里">

======================================

这是 Sherm 的解决方案 h/t

显然是我的目录出于某种原因,结构完全陷入困境,要么是我在不知不觉中完成的,要么是 Sherm 指出的 XCode 决定造成严重破坏,无论如何,(请忍受我令人难以置信的非技术性描述)在 XCode、黄色文件夹(或它们的组)中工作时。由于某种奇怪的原因调用它们)不会被添加到您的捆绑包中...因此 exiftool(如果您查看第一张图片)没有层次结构来查找其所需的文件,正如捆绑包屏幕截图所证明的那样,我基本上丢弃了所有文件。从应用程序中删除相关的 exiftool 文件(右键单击/删除/删除引用),然后从查找器中将它们带回。您会在第三个屏幕截图中注意到这些目录现在是蓝色的。这些将使用该应用程序构建。

在此处输入图像描述

But it's there.

enter image description here

any ideas?

It happens when I am trying to get metadata from an image file (this is AppleScript running a shell script):

on getMetaData(filePath)
-->get meta data
try
    set myCommand to (quoted form of (POSIX path of (pathToExifTool)) & " " & quoted form of (POSIX path of (filePath)))
    set thisMetaData to (do shell script myCommand)
on error errMsg
    log "Can't find exiftool:" & errMsg
end try
...

pathToExifTool is this:

/Users/steve/Desktop/XCodeApps/ImageArchiveDeluxeX/build/Release/ImageArchiveDeluxeX.app/Contents/Resources/exiftool"

and exists.

Here's the complete error thrown:

"Can't find exiftool:Can't locate Image/ExifTool.pm in @INC (@INC contains: /Users/steve/Desktop/XCodeApps/ImageArchiveDeluxeX/build/Release/ImageArchiveDeluxeX.app/Contents/Resources/lib /Library/Perl/Updates/5.8.8 /System/Library/Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /Library/Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /Network/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/5.8.6 /Library/Perl/5.8.1 .) at /Users/steve/Desktop/XCodeApps/ImageArchiveDeluxeX/build/Release/ImageArchiveDeluxeX.app/Contents/Resources/exiftool line 30.
BEGIN failed--compilation aborted at /Users/steve/Desktop/XCodeApps/ImageArchiveDeluxeX/build/Release/ImageArchiveDeluxeX.app/Contents/Resources/exiftool line 30."

Well the bundle is a mess (lots of .pm files floating about - they look to be duplicates) but the exiftool-->image-->ExifTool.pm path is there.

enter image description here

====================================

Here's the solution h/t to Sherm

Apparently my directory structure went all to hell for some reason, either I did it unknowingly or something with XCode as Sherm indicated decided to wreck havoc. Anyway, (bear with my incredibly non-technical description) when working in XCode, yellow folders (or groups as they call them for some odd reason) will not be added to your bundle...hence exiftool (if you look at the first image) had no hierarchy to find its needed files, as evidenced by the bundle screen capture. I basically trashed all the related exiftool files from the app (right click/delete/delete references) and then brought them back in from the finder. You'll note in the third screen cap those directories are now blue. These will be built with the app.

enter image description here

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

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

发布评论

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

评论(1

落叶缤纷 2024-11-03 04:30:43

您是否查看过应用程序包的 Resources/ dir 以验证复制这些文件时是否维护了目录结构? IIRC,这不会自动发生;默认行为是“扁平化”资源,忽略 Xcode 组并简单地将所有资源文件复制到顶级 Resources/ 目录中。

您可以通过删除这些组来避免默认行为。来自 Xcode 项目的文件引用 - 当然不要删除这些文件!然后,重新添加“lib”目录,注意选择“创建文件夹引用”选项。

“添加现有文件”选项表

Have you looked inside your app bundle's Resources/ dir to verify that the directory structure is maintained when you copy these files? IIRC, that doesn't happen automatically; the default behavior is to "flatten" resources, ignoring Xcode groups and simply copying all resource files into the top-level Resources/ directory.

You can avoid the default behavior by removing those groups & file references from your Xcode project - don't delete the files of course! Then, re-add the "lib" directory, taking care to choose the "Create Folder References" option.

"Add existing files" option sheet

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