Imageio Error Reading Png Image Data
Contents |
here for a quick overview of the site Help Center Detailed error reading png image data java answers to any questions you might have Meta Discuss the
Iioexception Error Reading Png Image Data
workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Javax.ImageIO.IIOException for PNG image Data up vote 1 down vote favorite I am implementing a server in java which recieves images from an android application. basically it is recieving image from android emulator but not from android device. This all process of recieving an image from android emulator or android device is done on localhost. here is my code of the server. public class Server { private static ServerSocket serverSocket; private static Socket clientSocket; private static InputStreamReader inputStreamReader; private static BufferedReader bufferedReader; private static String message; private static byte[] image; public static void main(String[] args) throws UnknownHostException, IOException { try { serverSocket = new ServerSocket(4000); // Server socket } catch (IOException e) { System.out.println("Could not listen on port: 4000"); } System.out.println("Server started. Listening to the port 4000"); while (true) { clientSocket = serverSocket.accept(); // accept the client connection inputStreamReader = new InputStreamReader(clientSocket.getInputStream()); bufferedReader = new BufferedReader(inputStreamReader); // get the client message DataInputStream inputFromClient = new DataInputStream(clientSocket.getInputStream()); int count = inputFromClient.available(); System.out.println(count); image = new byte[count]; inputFro
Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums Forum: Other JSE/JEE APIs Problem while reading PNG image through ImageIO API Amrut Chaudhary Greenhorn Posts: 3 posted 5 years ago http://stackoverflow.com/questions/29506088/javax-imageio-iioexception-for-png-image-data Hi, I am using the commons-fileupload API to upload images. I first write the image to disk and then load it via ImageIO.read(new FileInputStream("my.png")) it works fine for some PNG images but for some PNG image it https://coderanch.com/t/514477/java/java/reading-PNG-image-ImageIO-API gives me error like. javax.imageio.IIOException: Error reading PNG image data at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1291) at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1560) at javax.imageio.ImageIO.read(ImageIO.java:1422) at javax.imageio.ImageIO.read(ImageIO.java:1326) at com.asite.imageio.ImageIOTest.readImage(ImageIOTest.java:45) at com.asite.imageio.ImageIOTest.main(ImageIOTest.java:27) Caused by: java.io.EOFException: Unexpected end of ZLIB input stream at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:223) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) at java.io.BufferedInputStream.read(BufferedInputStream.java:317) at java.io.DataInputStream.readFully(DataInputStream.java:178) at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1075) at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1179) at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1284) ... 5 more Here is the code which i wrote to read image BufferedImage image =ImageIO.read(new FileInputStream("abc.png")); int width = image.getWidth(); int height = image.getHeight(); System.out.println("width : "+width+"\nheight : "+height); Lester Burnham Rancher Posts: 1337 posted 5 years ago Firstly, have you made sure that after the upload, the files are bit-for-bit identical copies of the orig
Creator Brought to you https://sourceforge.net/p/mobac/bugs/251/ by: r_x Summary Files Reviews Support External https://github.com/grails/grails-core/issues/9228 Link ▾ Forum Wiki Tickets ▾ Bugs Feature Requests Patches Code Create Ticket View Stats Group latest_beta_version latest_preview_version latest_stable_version outdated_version SVN_version Searches Changes Closed Tickets Open Tickets Help Formatting Help error reading #251 Error reading PNG image data Milestone: latest_stable_version Status: open Owner: nobody Labels: None Priority: 1 Updated: 2014-02-06 Created: 2013-07-25 Creator: PietroCal Private: No Version: Mobile Atlas Creator (MOBAC) 1.9.13 (2126) Platform: Windows XP (5.1) (windows) Java error reading png VM: Java HotSpot(TM) Client VM (1.7.0_25-b17) Max heap size: 989,88 MiB CPU cores: 1 Thread: AtlasThread 2 Map name=FRIULI 15 mapSource=OpenStreetMap 4UMaps.eu zoom=15 maxTileCoordinate=4513791/2985471 minTileCoordinate=4489472/2961664 parameters=null Map type: MAPPACK Map implementation: mp-openstreetmap.jar Map revision: 2126 Error hierarchy: MapCreationException: javax.imageio.IIOException: Error reading PNG image data IIOException: Error reading PNG image data ZipException: incorrect header check mobac.exceptions.MapCreationException: javax.imageio.IIOException: Error reading PNG image data at mobac.program.atlascreators.Ozi.createTiles(Ozi.java:238) at mobac.program.atlascreators.Ozi.createMap(Ozi.java:72) at mobac.program.AtlasThread.createMap(AtlasThread.java:355) at mobac.program.AtlasThread.createAtlas(AtlasThread.java:202) at mobac.program.AtlasThread.run(AtlasThread.java:120) Caused by: javax.imageio.IIOException: Error reading PNG image data at com.sun.imageio.plugins.png.PNGImageReader.readImage(Unknown Source) at com.sun.imageio.plugins.png.PNGImageReader.read(Unknown Source) at javax.imageio.ImageIO.read(Unknown Source) at javax.imageio.ImageIO.read(Unknown Source) at mobac.program.atlascreators.tileprovider.DownloadedTileProvider.getTileImage(DownloadedTileProvider.java:57) at mobac.program.atlascreators.Ozi.createTiles(Ozi.java:226) ... 4 more Caused by: java.util.zip.ZipException: incorrect header check at java.util.zip.InflaterInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source
Sign in Pricing Blog Support Search GitHub This repository Watch 199 Star 1,908 Fork 843 grails/grails-core Code Issues 153 Pull requests 10 Projects 0 Wiki Pulse Graphs New issue ImageIO fails reading random PNG file during tests #9228 Closed miffels opened this Issue Sep 7, 2015 · 3 comments Projects None yet Labels Cannot Reproduce Example Attached Not a Bug Milestone grails-3.0.6 Assignees graemerocher 2 participants miffels commented Sep 7, 2015 Hi all, After updating from Grails 3.0.2 to 3.0.5 I have had a breaking test that used to work before - it involves reading a PNG file from the local file system. I can read the file just fine from a regular Java as well as from the Grails console, so I figure this is somehow related to the Grails test context. $ grails -version | Grails Version: 3.0.2 | Groovy Version: 2.4.3 | JVM Version: 1.8.0_45 $ pngcheck default.png OK: default.png (800x600, 32-bit RGB+alpha, non-interlaced, 99.7%). Let's check in the console: $ grails console [...] import javax.imageio.ImageIO ImageIO.read(getClass().getResourceAsStream("/default.png")) So this looks fine - until I try reading it from a test case: $ grails test-app -unit [...] javax.imageio.IIOException: Error reading PNG image data at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1337) at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1606) at javax.imageio.ImageIO.read(ImageIO.java:1448) at javax.imageio.ImageIO.read(ImageIO.java:1352) at imageio.png.ImageIoSpec.test(ImageIoSpec.groovy:23) Caused by: java.util.zip.ZipException: invalid literal/lengths set at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164) at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) at java.io.BufferedInputStream.read(BufferedInputStream.java:265) at java.io.FilterInputStream.read(FilterInputStream.java:83) at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1104) at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1215) at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1330) ... 4 more You can find an SSCCE here. Best, Michael graemerocher added this to the grails-3.0.6 milestone Sep 7, 2015 graemerocher self-assigned this Sep 7, 2015 graemerocher added Example Attached Cannot Reproduce labels Sep 7, 2015 grails member graemerocher commented Sep 7, 2015 The test passes locally for me using the example provided. miffels commented Sep 7, 2015 Oh, this is odd. Very