Page 1 of 1

I can't find a broken image in a levelset's graphics.

Posted: Wed Dec 04, 2019 1:16 am
by Algebroot
I've decided to play a specific levelset when this error appeared while loading:
img_load() failed: bytes per line is too large (corrupt?)
The error message told me to check stderr.txt for details. I checked stderr.txt, but all I see is this:
rocksndiamonds.exe: fatal error: IMG_Load() failed: bytes per line is too large (corrupt?)
That doesn't help... :(

Re: I can't find a broken image in a levelset's graphics.

Posted: Tue Dec 10, 2019 11:01 pm
by Holger
That's indeed nasty (and really not helpful). :-(

This did work better in the past, but apparently the more detailed message that contains the file name which caused the error was "optimized away" (by mistake) a few years ago.

I've changed this now to always display the file name that caused the error.

BTW: Which level set caused such problems when trying to load it? Hopefully not one of those from the "Levels & Artwork" page?!

BTW2: This problem can be caused by broken (and now outdated) versions of SDL_image that causes problems with IFF/ILBM files, but I assume that you (or that level set) did not try to load such a (now exotic) image file format?

Re: I can't find a broken image in a levelset's graphics.

Posted: Mon Dec 16, 2019 11:51 am
by Algebroot
The levelset I was trying to play is "Negundo - The Planet Adventures" from the contributions levelsets.

Oddly, the "levelinfo.conf" file has "graphics_set" set to "ab_levelset4". It's not actually a meaningful observation; Just a strange oddity I found when trying to redirect the graphics.

BTW: elemu-project.de (the link on "Levels & Artwork" for Andreas Buschbeck's levelsets) seems to no longer exist, so I can't get "ab_levelset4" even if it could be important.

Re: I can't find a broken image in a levelset's graphics.

Posted: Tue Dec 17, 2019 10:15 am
by filbo
The problematic file is:

/usr/share/games/rocksndiamonds/levels/Contributions 1995 - 2006/Contributions_2004/rnd_rado_negundo_v/graphics/Back3.pcx

-- on my filesystem layout. Processing this file as follows 'fixes' it, in that RnD doesn't crash; but the resulting display is not good (the score panel to the right looks terrible), so I don't know if it's the right approach. Tools from 'netpbm':

Code: Select all

$ cd '/usr/share/games/rocksndiamonds/levels/Contributions 1995 - 2006/Contributions_2004/rnd_rado_negundo_v/graphics'
$ mv Back3.pcx Back3.pcx.orig
$ pcxtoppm < Back3.pcx.orig | ppmtopcx > Back3.pcx

Re: I can't find a broken image in a levelset's graphics.

Posted: Tue Dec 17, 2019 10:21 am
by filbo
Also (`identify` from ImageMagick):

Code: Select all

$ identify Back3.pcx.orig
Back3.pcx.orig PCX 101x280 101x280+0+0 8-bit DirectClass 92.6KB 0.000u 0:00.000
$ identify Back3.pcx
Back3.pcx PCX 101x280 101x280+0+0 8-bit PseudoClass 256c 29.2KB 0.000u 0:00.000
Note the difference of 'DirectClass' vs. 'PseudoClass'. However, the other *.pcx files in the graphics set are mixed between those two types, so it isn't that the SDL image library can't handle one; more likely the original has some sort of subtle nonstandard encoding.

Re: I can't find a broken image in a levelset's graphics.

Posted: Wed Dec 18, 2019 7:50 am
by Eizzoux
I remember actually having the same problems from 3.3.0.1.
The first thing I tried to do to is just convert all ".pcx" files to ".png" and then replace all game sprite definitions correspondingly from ABToons.pcx to ABToons.png, Generic1.pcx to Generic1.png, etc. And that worked out pretty well! At least for me it shows no more error codes. Not sure if it will work out for you, so maybe you can try, here's the "fixed" version:
rnd_rado_negundo_v_fixed.zip
(1.52 MiB) Downloaded 22 times
Yeah, still weird issue, maybe it has to do something with the PCX format compatibility limitations, that kinda makes SDL having troubles reading PCX? Or the opposite, png is much simpler for SDL to work with?

Re: I can't find a broken image in a levelset's graphics.

Posted: Sun Dec 29, 2019 12:47 am
by Algebroot
filbo wrote:
Tue Dec 17, 2019 10:15 am
the resulting display is not good (the score panel to the right looks terrible), so I don't know if it's the right approach.
Based on that description, it may not be the processing.

RocksDoor.pcx actually is edited like that. It's monochrome, heavily blurred, and all its transparency has been replaced with a gradient. There's no way to make it look good even after fixing the transparency.