tmp$surface.matrix not equivalent to logo_NA$surface.matrix.
Lengths differ: 309738 is not 310479

test_that("x3p_trim_na works as expected", {
logo_NA$surface.matrix[logo_NA$surface.matrix == median(logo_NA$surface.matrix)] <- NA
"image rendered from the CSAFE logo ; cropped from location ( 36 , 73 )"
na_rows <- apply(logo_NA$surface.matrix, MAR=1, FUN = function(x) {sum(is.na(x))})
na_cols <- apply(logo_NA$surface.matrix, MAR=2, FUN = function(x) {sum(is.na(x))})
idx_rows <- range(which(abs(diff(na_rows == 419))==1))
idx_cols <- range(which(abs(diff(na_cols == 741))==1))
# missing values inside the file should not be removed
# trimming a file without missing value should not do anything

logo$surface.matrix not equivalent to tmp$surface.matrix.
Lengths differ: 310479 is not 309738