简体   繁体   中英

Java ImageIO.read causing OSX to hang

I'm having to do some bits with reading in an image on Mac OSX, however it seems to hang when calling ImageIO.read ( File ). No stack trace seems to appear either, it literally just hangs. Was wondering if anyone else had experienced this problem?

I've been successful in writing an image, just seems to be a problem with reading. Working with .png files.

OSX 10.9.2 Java 1.7.40

The solution I found in the end was to do the following on the mac

File scrFile = ((TakesScreenshot)seleniumCommonHandler.getCurrentSeleniumDriver())
.getScreenshotAs(OutputType.FILE);

BufferedImage img = ImageIO.read( scrFile );

For some reason the ImageIO no matter what I tried could not read the image directly from the file system. By using this approach I managed to get around the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM