Running examples in ‘trackter-Ex.R’ failed
The error most likely occurred in:

> ### Name: kin.search
> ### Title: Midline tracking over image sequences
> ### Aliases: kin.search
> 
> ### ** Examples
> 
> 
> #### plot lot caudal amplitude and produce a classic midline waveform plot of swimming fish	
> ##A very long example.
> ## Not run: 
> ##D 	
> ##D 
> ##D #download example images and place in 'example' subdirectory	
> ##D f <- "https://github.com/ckenaley/exampledata/blob/master/example.zip?raw=true"	
> ##D 
> ##D download.file(f, paste0(tempdir(),"/temp.zip"))
> ##D unzip(paste0(tempdir(),"/temp.zip"), exdir=tempdir())	
> ##D unlink(paste0(tempdir(),"/temp.zip"))	
> ##D 
> ##D dir.create(paste0(tempdir(),"/processed_images"))
> ##D kin <- kin.search(image.dir =paste0(tempdir(),"/example"),	
> ##D        search.for = "largest",	
> ##D       smoothing = "loess",frames=1:50,
> ##D       out.dir=paste0(tempdir(),"/processed_images"),
> ##D       show.prog = FALSE,thr = "otsu",	
> ##D       image.type="bin",smooth=0.4)	
> ##D 
> ##D #plot instantaneous amplitude of tail (last/rightmost point) over frames 	
> ##D p <- ggplot(dat=kin$kin.dat,aes(x=frame,y=amp))+geom_line()+geom_point()+theme_classic(15)
> ##D print(p)	
> ##D 	
> ##D # midline plot	
> ##D ml <- kin$midline	
> ##D #leftmost x starts at 0	
> ##D ml <- ml[,x2:=x-x[1],by=frame]	
> ##D 
> ##D ml <- merge(ml,kin$kin.dat[,list(frame,amp)],by="frame") #merge these	
> ##D 
> ##D pal <- wes_palette("Zissou1", 100, type = "continuous") #"Zissou" color palette
> ##D 
> ##D p <- ggplot(dat=ml,aes(x=x2,y=wave.y))+theme_classic(15)+scale_color_gradientn(colours = pal)	
> ##D p <- p+geom_line(aes(group=frame,color=amp),stat="smooth",method = "loess", size = 1.5)	
> ##D print(p)	
> ##D 	
> ##D #Make a video of processed frames	
> ##D 
> ##D images.to.video2(image.dir=paste0(tempdir(),"/processed_images"),	
> ##D vid.name="trout_test",out.dir=tempdir(),frame.rate=5,qual=100,raw=FALSE)	
> ##D file.exists(paste0(tempdir(),"/trout_test_red.mp4"))
> ##D 
> ## End(Not run)
> 
> ## A very short example.
> 
> #retrieve image 
> i <- EBImage::readImage(system.file("extdata/img", "sunfish_BCF.jpg", package = "trackter"))
> #create directory and write image to it
> t <- tempdir()
> 
> 
> dir.create(paste0(t,"/images"))
> EBImage::writeImage(i,paste0(t,"/images/sunfish001.jpg"),type = "jpeg")
> 
> list.files(paste0(t,"/images"))
[1] "sunfish001.jpg"
> #run kin.search and save output image to directory
> kin.i<- kin.search(image.dir = paste0(t,"/images"),smooth=0.7,save = TRUE,out.dir = t)
Warning: `data_frame()` was deprecated in tibble 1.1.0.
Please use `tibble()` instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
Wrong JPEG library version: library is 62, caller expects 90
> 
> #plot midline over original image
> with(kin.i$midline,plot(x,wave.y))
> 
> i2 <- EBImage::readImage(paste0(t,"/sunfish001_000.jpg"))
Error in readJPEG(x, ...) : JPEG decompression error: Empty input file
Calls: <Anonymous> -> .loadFun -> .readFun -> readJPEG
Execution halted