开发者

Working in Xcode: Can't find exiftool:Can't locate Image/ExifTool.pm

开发者 https://www.devze.com 2023-02-19 06:29 出处:网络
But it\'s there. any ideas? It happens when I am trying to get metadata from an image file (this is AppleScript running a shell script):

But it's there.

Working in Xcode: Can't find exiftool:Can't locate Image/ExifTool.pm

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.

Working in Xcode: Can't find exiftool:Can't locate Image/ExifTool.pm

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

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.

Working in Xcode: Can't find exiftool:Can't locate Image/ExifTool.pm


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.

Working in Xcode: Can't find exiftool:Can't locate Image/ExifTool.pm

0

精彩评论

暂无评论...
验证码 换一张
取 消