我运行一个 java 聊天游戏客户端,它会在聊天中显示之前加载图片。
我确实通过 Yahoo Smush.it 压缩了我们在聊天游戏中使用的所有图片,但在 Java 控制台中出现此错误后:
java.util.zip.ZipException: unknown compression method
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at sun.awt.image.PNGImageDecoder.produceImage(PNGImageDecoder.java:344)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
Uncaught error fetching image:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at sun.awt.image.PNGFilterInputStream.read(PNGImageDecoder.java:810)
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:221)
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 sun.awt.image.PNGImageDecoder.produceImage(PNGImageDecoder.java:346)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
但是现在我已经在 Photoshop 中打开了每张图片并再次保存,但它占用了超过 20MB 的磁盘空间,所以我的问题是:
如何正确压缩所有图像,而不会与 java 压缩发生冲突?有什么网站吗?