EBImage read png causes R to crash
2
1
Entering edit mode
@henning-redestig-6447
Last seen 6.5 years ago
Germany

If I repeat the following

library(EBImage)
im <- readImage("http://i.imgur.com/HngATlw.png", type="png")
im <- resize(im, w=20)

a couple of times my R session crashes with

 *** caught segfault ***

address 0xe10010c6, cause 'memory not mapped'

I can reproduce both on windows 

R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] EBImage_4.12.0 devtools_1.9.1

loaded via a namespace (and not attached):
 [1] compiler_3.2.2      parallel_3.2.2      tools_3.2.2        
 [4] fftwtools_0.9-7     abind_1.4-3         memoise_0.2.1      
 [7] jpeg_0.1-8          grid_3.2.2          locfit_1.5-9.1     
[10] tiff_0.1-5          BiocGenerics_0.16.0 digest_0.6.8       
[13] png_0.1-7           lattice_0.20-33    

 

and on Linux

 R version 3.2.2 (2015-08-14)
 Platform: x86_64-pc-linux-gnu (64-bit)
 Running under: Red Hat Enterprise Linux Server release 6.6 (Santiago)

 locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8
  [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C
 [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

 attached base packages:
 [1] stats     graphics  datasets  grDevices utils     methods   base

 other attached packages:
 [1] EBImage_4.12.1

 loaded via a namespace (and not attached):
  [1] compiler_3.2.2      parallel_3.2.2      tools_3.2.2         fftwtools_0.9-7
  [5] abind_1.4-3         memoise_0.2.1       jpeg_0.1-8          grid_3.2.2
  [9] locfit_1.5-9.1      tiff_0.1-5          BiocGenerics_0.16.0 digest_0.6.8
 [13] devtools_1.9.1      png_0.1-7           lattice_0.20-33

 

but not with any png file - though that png works flawlessly in all other programs I try like imagemagick, irfanview, gimp etc.

 

ebimage bug • 1.6k views
ADD COMMENT
2
Entering edit mode
Andrzej Oleś ▴ 750
@andrzej-oles-5540
Last seen 3.4 years ago
Heidelberg, Germany

Thank you for reporting the bug, I was able to reproduce it.

The observed behaviour was related to the presence of the alpha channel in your sample image rather than to the PNG format itself. There was an issue with handling images containing the alpha channel by the downstream transformation function affine(), which is called by resize() to perform the scaling.

This is now fixed in release, EBImage version 4.12.2.

Cheers,

Andrzej

ADD COMMENT
0
Entering edit mode
@henning-redestig-6447
Last seen 6.5 years ago
Germany

Hey, great! Thanks for the fix!

ADD COMMENT

Login before adding your answer.

Traffic: 888 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6