imageRename results in corrupted files

17 views
Skip to first unread message

Ben Padilla

unread,
Apr 11, 2024, 10:37:03 PMApr 11
to camtrapR
Hello, 
I am using imageRename and am finding that many of the resulting photos in the outdir are corrupted files, that is, they have no data associated with them (file size is 0 kb and no image is there when clicked on). Below is a snippet of the code. ARCHIE_1 here is a site folder with folders in it for each SD card pulled from the camera, these are labeled using the following format:  ARCHIE_1-03-02-22. It may also be worth noting that the drive where these files are located is a network drive. In some cases more than half of the photos in the original files are copied to outdir as corrupted files. Aany suggestions? 

# Where the photos are
orig_photos <- "Z://Post-Fire_Monitoring_Data/ARCHIE_CREEK/Photo_Data/Original_Photos/ARCHIE_1"
# Where the photos go
renamed_photos <- "Z://Post-Fire_Monitoring_Data/ARCHIE_CREEK/Photo_Data/Processed_Photos/ARCHIE_1"

imageRename(inDir = orig_photos,
                            outDir = renamed_photos,
                            hasCameraFolders = F,
                            keepCameraSubfolders = F,
                            writecsv = TRUE,
                            copyImages = TRUE,
                            createEmptyDirectories = TRUE)

Jürgen Niedballa

unread,
Apr 17, 2024, 6:09:37 PMApr 17
to Ben Padilla, camtrapR
Hello
I have not seen this issue before and I doubt it is directly related to camtrapR. If I had to take a guess it more likely has to do with the way R interacts with the network drive.
Did you try it on a local drive? That would probably be the easiest solution, first rename locally, then store on the network drive.
If images get corrupted when running it on a local drive please let me know, that would be something to look into more carefully.
Thank you

--
You received this message because you are subscribed to the Google Groups "camtrapR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camtrapr+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/camtrapr/2676cbd6-8d40-4323-bb0b-9560db142fb6n%40googlegroups.com.

Ben Padilla

unread,
May 1, 2024, 8:46:13 PMMay 1
to Jürgen Niedballa, camtrapR
Hello Jürgen, 
Sorry for the late reply, but I want to close the loop here. I did download a large chunk of the data to my local machine and didnt run in to this issue. I did it a few times with different batches of photos to be sure. It doesnt appear to be a camtrapR issue. 
Thanks for your help. 
Ben
--


Benjamin Padilla Ph.D
Wildlife Research Supervisor
Oregon Department of Fish and Wildlife
Twitter: @bpdilla ~ Web: www.benpadilla.weebly.com

Reply all
Reply to author
Forward
0 new messages