• 中文
  • Spine 3.8.97 导出时,打包图片出错

Related Discussions
...

有个2.1.27的工程,使用这个版本的spine导出没有任何问题

但是最近把spine升级到了3.8.97,runtime也用了最新的运行库,打开这个工程时,选择同样的
导出设置,会报错:“打包图片时出错 出错:negative or zero width”,日志里错误信息如下:

WARNING: Error packing images:
java.awt.image.RasterFormatException: negative or zero width
at java.desktop/java.awt.image.Raster.<init>(Unknown Source)
at java.desktop/java.awt.image.WritableRaster.<init>(Unknown Source)
at java.desktop/sun.awt.image.SunWritableRaster.<init>(Unknown Source)
at java.desktop/sun.awt.image.ByteComponentRaster.<init>(Unknown Source)
at java.desktop/sun.awt.image.ByteInterleavedRaster.<init>(Unknown Source)
at java.desktop/sun.awt.image.ByteInterleavedRaster.createWritableChild(Unknown Source)
at FI.<init>(SourceFile:38)
at Fs.V(SourceFile:49)
at Fj.I(SourceFile:209)
at Fj.V(SourceFile:96)
at Fj.V(SourceFile:88)
at FJ.V(SourceFile:148)
at Fr.V(SourceFile:96)
at EW.V(SourceFile:256)
at Fb.V(SourceFile:219)
at EW.V(SourceFile:57)
at EW.V(SourceFile:163)
at CZ.V(SourceFile:86)
at Bd.run(SourceFile:671)
at java.base/java.lang.Thread.run(Unknown Source)


3.8.00-beta 这个版本打包是好的
3.7.94也是好的
3.8.55以上测试都有这个错误

This seems to be a problem when Spine is removing whitespace when packing a texture atlas. We haven't seen the problem, maybe you could send your images so we can see the crash? <removed> You may be able to remove images until you find the one that causes the problem. Could it be that you have an image that is completely blank?
当Spine在打包纹理图集时删除空白时,这似乎是一个问题。 我们还没有发现问题,也许您可以发送图片,以便我们看到崩溃? <removed>在找到导致问题的图像之前,您可以删除图像。 可能是您的图像完全空白吗?

你有邮箱么? 贴一个给我,我给你发100%出错的工程图片

邮件已发送,注意查收

Thank you for the image files. We found that back_center_skirt.png is a 1x1 image that is blank. Unfortunately there is a bug with Spine's texture packer when strip whitespace is enabled. It cannot handle a completely blank image. We have fixed the problem in 4.0. In version 3.8.97 your options to workaround the problem are:
1) You could disable whitespace stripping.
2) Or, you could make the image so it is not 0/255 opacity. Eg, set it to a white pixel that is 1/255 opacity.
3) Or, you can pack the atlas by running the texture packer separately, not as part of JSON or binary data export. When doing that you can avoid the bug by unchecking Current project in the texture packer settings (that means meshes won't be used for whitespace stripping).

感谢您提供的图像文件。 我们发现back_center_skirt.png是1x1的空白图像。 不幸的是,启用条带空白时,Spine的纹理打包器存在一个错误。 它无法处理完全空白的图像。 我们已经在4.0中修复了该问题。 在版本3.8.97中,解决此问题的选项是:
1)您可以禁用空格剥离。
2)或者,您可以使图像不具有0/255不透明度。 例如,将其设置为不透明度为1/255的白色像素。
3)或者,您可以通过单独运行纹理打包器来打包地图集,而不是作为JSON或二进制数据导出的一部分。 这样做时,您可以通过取消选中纹理打包程序设置中的当前项目来避免该错误(这意味着网格将不会用于空白剥离)。

我去除了打包菜单中的 “去除X轴空白区”/“去除Y轴空白区” 这两个选项后,可以正常打包图片了,感谢!