[Fixed for V0.45] Path character limit for imported graphics

Messages are moved here (should anyone ever want to see them again) once they are no longer applicable to the current version (e.g. suggestions that have been implemented or bugs that have been fixed).

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Parallax
DMwiki contributor
Posts: 424
Joined: Mon Aug 28, 2006 7:56 pm
Location: Back in New Jersey

[Fixed for V0.45] Path character limit for imported graphics

Post by Parallax »

When importing new graphics (and sounds, possibly) in the RTC editor, the importing will fail if the path (including the new file name) is longer than 36 characters. No error message, nothing, it just goes back to the new bitmap window without filling out the proper field. It took me a while figuring out what was happening. At first I thought it was a problem with the file format, but no, it's the path length.

I don't know how easy it would be to raise the character limit to something sensible, like 256 characters, or something, but would it be possible to have at least a 'path too long' error implemented so the user knows why his files are being turned down?
User avatar
Lee
Artisan
Posts: 182
Joined: Wed Mar 16, 2005 8:09 pm
Location: Montréal
Contact:

Post by Lee »

Are you one of those people who have tons of unnecessary folders lying around everywhere, so a path could look something like C:\Program Files\Return To Chaos\Bits & Bobs\New Folder\Images\New Images For Dungeon\Beta Versions Of Images Ready For New Dungeon\image.jpg? :lol:

Nevertheless, I understand that not everyone has their computers cleaned up with a simplified filing system so if this bug is a case of what Parallax is saying... maybe an increase in characters wouldn't hurt.
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

I think this might have sometthing to do with taking ADGE graphics or other ripped files, which can have long file names - so its a case of if this is an easy fix then could save people using ripped graphics alot of time trimming file names
User avatar
Parallax
DMwiki contributor
Posts: 424
Joined: Mon Aug 28, 2006 7:56 pm
Location: Back in New Jersey

Post by Parallax »

Actually, the graphics that gave me trouble did not have the ADGE-genrerated, insanely long file name. But something as simple as (from the RTC directory) Artwork\ConfluxIII\Wallitems\rogue_f.png, case in point, fails to load properly. I'm not even asking for a fix if it's inconvenient, just an error message to tell the next person (who might be me, my memory is not so good anymore) what is happening. and why, so they don't waste their time fiddling with the file format.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Are you sure it's the length of the path? I haven't used the editor for a while, but I have VERY long paths to my resources and never had problems using them on earlier versions of the editor.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Re: Path character limit for imported graphics

Post by George Gilbert »

Parallax wrote:When importing new graphics (and sounds, possibly) in the RTC editor, the importing will fail if the path (including the new file name) is longer than 36 characters. No error message, nothing, it just goes back to the new bitmap window without filling out the proper field. It took me a while figuring out what was happening. At first I thought it was a problem with the file format, but no, it's the path length.

I don't know how easy it would be to raise the character limit to something sensible, like 256 characters, or something, but would it be possible to have at least a 'path too long' error implemented so the user knows why his files are being turned down?
I can't reproduce the crash you're seeing given the instructions above. The path limit in the editor is already 1024 characters; there must be something else going on here.

What makes you so certain that it's the path limit that's causing you problems? For example, if you simply rename the file that's causing the crash, does it go away?
User avatar
Parallax
DMwiki contributor
Posts: 424
Joined: Mon Aug 28, 2006 7:56 pm
Location: Back in New Jersey

Post by Parallax »

Yes, changing the file name or the directory name can make it work. And the editor doesn't crash, it just doesn't load the file. It returns to its previous window without filling out the grayed field for the path or loading the image, as if I had clicked 'cancel' instead of 'load'.

I still have older RTC versions in their own RTC_0.4x directories. In particular, I started a custom dungeon when .42 was around so I kept custom art in there. Now I'm using 0.44, so I had copied the files I wanted to the 0.44 directory. When loading the graphics stored in the 0.44 directory didn't work I tried loading those in the 0.42 directory, which worked. At that point I started fiddling with the path and the file name in the 0.44 directory and, once I had shortened them enough, was able to load these files as well, which made me think it was something to do with a limit on the path length.

But if it is not the path length then I don't know what it is. And rest assured that all attempts at loading images where made with the RTCEditor from the .44 package.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Nope - still can't reproduce it. This is what I am doing; can you do the same and get a different result?

- Start the editor up.
- Select "File/New"
- Select "Resources/Add replace graphics"
- Select "Add new bitmap"
- Select "..."
- Select "Modules/abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.png" (65 characters).

...and the name appears in the name box and the image appears in the image box.

What happens for you (and assuming that the above works, what *else* do you have to do to cause the problem)?
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Parallax, you need to send the offending file to GG and GG you need to put it in the same location as Parallax and see if anything weird happens... ;) 100% certain it won't make any difference, but you should at least replicate EXACTLY what he's doing.
User avatar
Parallax
DMwiki contributor
Posts: 424
Joined: Mon Aug 28, 2006 7:56 pm
Location: Back in New Jersey

Post by Parallax »

OK, then we have a problem. I've tried it, with your double alphabet name, and the image doesn't load and the name doesn't appear in the box. A copy of the same image, in the same directory, with a short name (rogue_f.png) loads as it should.

I have tried saving like that and changing the name with a text editor (notepad) in the .txt file so that abc... is loaded instead, and it works when I reopen the txt file with RTCeditor. If I change the target image to rogue_f.png it works, and shifting back to abc... doesn't.

I don't know what else to say, if you can't reproduce it maybe there's something wrong on my end, but I am at a loss as to what it could be.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Fixed for V0.45

Finally found the problem - nothing to do with RTCs handling of the filename, it was the Windows API call to get the filename that was messing it up!
Post Reply