EBImage cannot read .png images from Image.R
1
0
Entering edit mode
benauxier • 0
@benauxier-13262
Last seen 4.9 years ago

Trying to use the annotation_image() function from ggtree package, which was working before, but is not working currently. The error message I get is:

Error in FUN(X[[i]], ...) :
Invalid type: png". Currently supported formats are JPEG, PNG, and TIFF.

I tracked this to the Image.R script from EBImage, and it looks like it is coming from the determineFileType() function, since it is returning png" (note the single parentheses?). I am wondering if anyone knows anything about this?

The versions I am using are ggtree 1.8.1, EBImage 4.18.0, R 3.4.0

ebimage ggtree • 1.0k views
1
Entering edit mode

• a (minimal) code example
• make sure you use recent package versions, and provide the output of devtools::session_info() ?
0
Entering edit mode
Andrzej Oleś ▴ 750
@andrzej-oles-5540
Last seen 18 months ago
Heidelberg, Germany

Your description indicates a problem with either the input filename or downstream package functions calling EBImage functions. The quotation mark in the error message looks suspicious indeed, as it suggests that the filename passed to readImage wrongly contains a quotation mark, i.e. filename.png". It is unlikely that any recent update to EBImage could be the cause, as the relevant parts of code in Image.R haven't been touched for the last few releases.

Cheers,

Andrzej