Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exiftoolr can't find Exiftool #1

Closed
Nova-Scotia opened this issue Jul 12, 2019 · 8 comments
Closed

exiftoolr can't find Exiftool #1

Nova-Scotia opened this issue Jul 12, 2019 · 8 comments

Comments

@Nova-Scotia
Copy link

Nova-Scotia commented Jul 12, 2019

Hi Josh,

I'm teaching an R workshop next week and some of my code uses exiftoolr to teach folks how to extract and view photo metadata. Thanks for making this great package!

While my computer can "see" Exiftool, many of the participants are struggling to point exiftoolr to Exiftool. They keep getting errors.

Of note:

  • We're using windows 10, R v 3.6.1
  • My R files are completely separate from OneDrive, whereas participants' libraries are generally stored on their OneDrive
  • When I looked in the folder C:/Users/UserName/OneDrive - Government/Documents/R/win-library/3.6/exiftoolr/exiftool, I found that Exiftool was there, but it was named "exiftool(-k)". I deleted the (-k) part and tried again - no dice.
Here's what we tried:
library(exiftoolr)

# Install from the web
install_exiftool()

Attempting to download ExifTool from https://sno.phy.queensu.ca/~phil/exiftool/exiftool-11.55.zip
Error in curl_download(install_url, tmpfile, quiet = quiet) : 
  Timeout was reached: Connection timed out after 10000 milliseconds

# That didn't work - install from local zip file downloaded from internet
install_exiftool(local_exiftool = "C:\\Users\\UserName\\Downloads\\exiftool-11.55.zip")

Installing ExifTool in C:/Users/UserName/OneDrive - Government/Documents/R/win-library/3.6/exiftoolr/exiftool

exif_read("test.JPG")
Error in configure_exiftoolr(quiet = quiet) : 
  No functioning version of Exiftool has been found. To
download and install a local version into the exiftoolr
package, try doing install_exiftool().

.libPaths()
[1] "C:/Users/UserName/OneDrive - Government/Documents/R/win-library/3.6"
[2] "C:/Program Files/R/R-3.6.1/library

Any suggestions you have are much appreciated!

@JoshOBrien
Copy link
Owner

Hi @Nova-Scotia,

Glad you found the package and are liking it.

This might be a little hard for me to debug, since firstly, I have no experience with OneDrive, and secondly, downloading a zip file and using the local_exiftool= argument to install it works just fine for me. Would you mind giving me a little bit more information?

  • After running install_exiftool(local_exiftool = "C:\\Users\\UserName\\Downloads\\exiftool-11.55.zip"), do you find the executable (as I hope you do) at:

    C:/Users/UserName/OneDrive - Government/Documents/R/win-library/3.6/exiftoolr/exiftool/win_exe/exiftool(-k).exe

    i.e., is the executable in that /win_exe/ subdirectory?

  • After a fresh install of exiftoolr, followed by a call to install_exiftool(), does the call configure_exiftoolr() fail? If so, what messages does it give you in the process?

  • Following installation of "exiftool-11.55.zip"", what paths do you get when you run each of the following?

    system.file("exiftool", package = "exiftoolr")
    system.file("exiftool/win_exe", package = "exiftoolr")
    system.file("exiftool/win_exe/exiftool(-k).exe", package = "exiftoolr")

Not sure any of this will help, but it's what I'd start by checking if I was sitting in front of your computer.

Hope we can get this figured out.

Cheers,

Josh

@JoshOBrien
Copy link
Owner

@Nova-Scotia -- I should also mention that, as a stopgap, you can have the workshop attendees unzip the ExifTool executable locally and then use configure_exiftool() to point to it. This isn't quite as nice as just calling install_exiftool() once and being off to the races, but it should work just fine.

library(exiftoolr)

## Unzip the exiftool executable & configure exiftoolr to use it.
td <- tempdir()
unzip("exiftool-11.55.zip", exdir = td)
exiftool_path <- dir(td, full.names = TRUE)
configure_exiftoolr(command = exiftool_path)

## Confirm that this worked
exiftoolr:::get_exiftool_command()
## [1] "C:\\tmp\\RtmpC2wHUr/exiftool(-k).exe"

@Nova-Scotia
Copy link
Author

Nova-Scotia commented Jul 15, 2019

Thanks @JoshOBrien , I'll send this to the participants who are having trouble - hopefully the temporary fix works. Some participants have administrative privs, some don't - not sure if we'll be able to get anything to work for those that don't... but seeing as how you don't have to "install" exiftool to use it, hopefully we do find a workaround!

@Nova-Scotia
Copy link
Author

I haven't gotten back results from the first checks you suggested @JoshOBrien , but we have had some success - I think the issue might be in the unzip command, as in both cases the participants with issues had to manually unzip the .exe file. In one case unzipping manually and installing from a local copy of the .exe file worked, and in another case your direction for a "stop-gap" solution worked. Here's what the second individual tried to successfully get the programs to speak to each other:

# First, manually download "exiftool" and then unzip it to a directory (here, my downloads folder). 
library(exiftoolr)
td <- "C:/Users/UserName/Downloads/exiftool-11.55"  # directory containing *unzipped* folder “exiftool-11.55”
exiftool_path <- dir(td, full.names = TRUE)
configure_exiftoolr(command = exiftool_path)

exiftoolr:::get_exifttool_command()

exif_read("test.JPG") # test image

I'll see if we can get someone to report on error messages later this week.

@JoshOBrien
Copy link
Owner

Thanks for the report, @Nova-Scotia.

Your suspicion that the issue may be related to unzip makes a lot of sense. (FTR, here is a thread with reports of similarly variable failures, definitely related to unzip, by users of the remotes package, which underlies RStudio's devtools.)

I'll definitely be interested to hear whatever else you learn, as I'd like to provide better instructions for folks who run into problems like your participants have reported.

@JoshOBrien
Copy link
Owner

JoshOBrien commented Nov 10, 2021

FTR, in February, 2020, I attempted to address this issue by moving from utils::unzip() to zip::unzip() (commit 7fd9766) . Haven't heard any more complaints along these lines, so maybe that really did make the call to unzip() in install_exiftool() more robust, as I'd hoped/expected.

@DrPhysiker
Copy link

why is Bitdefender detecting you app as threat
image

@JoshOBrien
Copy link
Owner

@DrPhysiker It's not detecting my R package. It looks like it's detecting ExifTool (homepage here), the app for which my package is just a wrapper. So this is an issue for either ExifTool or Bitdefender.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants