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

Stuck at a level? Need help with R'n'D or anything R'n'D related? Post here!

Moderators: Zomis, Flumminator

Post Reply
Algebroot
Posts: 8
Joined: Tue Mar 04, 2014 8:13 pm

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

Post by Algebroot » Wed Dec 04, 2019 1:16 am

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... :(

User avatar
Holger
Site Admin
Posts: 3246
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

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

Post by Holger » Tue Dec 10, 2019 11:01 pm

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?

Algebroot
Posts: 8
Joined: Tue Mar 04, 2014 8:13 pm

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

Post by Algebroot » Mon Dec 16, 2019 11:51 am

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.

filbo
Posts: 370
Joined: Fri Jun 20, 2014 10:06 am

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

Post by filbo » Tue Dec 17, 2019 10:15 am

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

filbo
Posts: 370
Joined: Fri Jun 20, 2014 10:06 am

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

Post by filbo » Tue Dec 17, 2019 10:21 am

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.

Eizzoux
Posts: 315
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

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

Post by Eizzoux » Wed Dec 18, 2019 7:50 am

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 21 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?
Nothing in here...*

Algebroot
Posts: 8
Joined: Tue Mar 04, 2014 8:13 pm

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

Post by Algebroot » Sun Dec 29, 2019 12:47 am

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.

Post Reply