JoshOBrien / exiftoolr

ExifTool Functionality from R
https://joshobrien.github.io/exiftoolr/
23 stars 1 forks source link

`exiftoolr` can't find Exiftool #1

Closed Nova-Scotia closed 4 years ago

Nova-Scotia commented 5 years ago

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:

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 commented 5 years ago

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?

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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 2 years ago

FTR, in February, 2020, I attempted to address this issue by moving from utils::unzip() to zip::unzip() (commit 7fd9766af86d69) . 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 commented 1 year ago

why is Bitdefender detecting you app as threat image

JoshOBrien commented 1 year ago

@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.