File Name Shenanigans

I'm playing around with the Forgotten Adventures PNGs and running into an interesting issue. Guessing it's either filename length or naming convention related. No matter which of these four I pick I always get the one displayed in red. Any ideas on how to deal with it? I'm just loading the PNGs so would creating a Symbol Catlog help?



Filenames are:

05/29/2020 09:00 AM           39,158 Cave_to_Dungeon_Wall_Transition_Straight_1x2_A.png

05/29/2020 09:00 AM           37,897 Cave_to_Dungeon_Wall_Transition_Straight_1x2_B.png

05/29/2020 08:59 AM           68,039 Cave_to_Dungeon_Wall_Transition_Straight_2x2_A.png

05/29/2020 08:59 AM           73,039 Cave_to_Dungeon_Wall_Transition_Straight_2x2_B.png


Cutoff seems to be at 32 characters (Cave_to_Dungeon_Wall_Transition_). Given that's 2^5, guessing it's not a coincidence?

Best Answer

  • MonsenMonsen Administrator 🖼️ 46 images Cartographer
    Accepted Answer

    Yes, you can have the long filenames in a symbol catalog just fine, it is just the symbol name that is the issue. The problem really occurs here because CC3+ automatically generates symbol names from file names, and if the file names are too long, it just truncates the file names.

    The annoying part of handling this when making symbol catalog is that you can't simply import a folder full of png's and let everything happen automatically. What you have to do is to import the folder. Then go into symbol manager, rename the symbols that would have conflicting names (i.e. the same first 31 characters), then import the folder again (with the Update option and not Rebuild set). You will have to repeat this as many times as you have duplicate names, so if 10 symbols share the first 31 characters, it's doing this loop 10 times :(

    Of course, if you have multiple groups with conflicting names, you handle 11 symbol from each group for each loop and not just a single symbol.

    Fortunately, while this can be a bit frustrating, it is only when making the symbol catalog. And you don't need to touch the file names, meaning that if you put the collection inside your data directory before starting and then use relative paths for the file names, others could use the same catalogs too (which is why doing these things as a community project may pay off)

Answers

  • LoopysueLoopysue ProFantasy 🖼️ 39 images Cartographer

    I believe you are right.

    Would changing the filenames be a big problem? I remember from your other thread that you had some idea of constantly updating from the download source, which would mean you couldn't change the filenames. Was I wrong about that?

  • I think it's the filename length, I've had similar problems.

    I'm not sure what the name length limit is, but whenever I add some symbols, I use Bulk Rename Utility which I got from here: https://www.bulkrenameutility.co.uk/

    I shorten all the filenames to something reasonable that still identifies where it came from (in case of red cross icon problems later).

  • No, not wrong, but I might be able to use symbolic links to overcome that. I think I'll open a support ticket on it -- 32 charachters is a serious limitation that really hurts the ability to use third party content.

  • MonsenMonsen Administrator 🖼️ 46 images Cartographer
    edited October 2020

    Note that 32 characters (31 actually, the 32nd is used for the null terminator) is a limit on symbol names, not file names, but it do come into play when opening folders of png's, and also when importing images into symbol catalogs, you need to handle things a bit more manually in that case.

    The limit can probably be changed, but it would probably completely break backwards compatibility, so if it is to be changed, it is probably something better suited for the next major version of Campaign Cartographer. That's not my call to make though.

  • Is it possible to add them to Symbol Catalog's with the long filenames? If there is a null string terminator being used, then would be interesting so see how much would break by increasing the length.

    Also if WIndows still generates 8.3 filenames then it might be possible to use that.

  • MonsenMonsen Administrator 🖼️ 46 images Cartographer
    Accepted Answer

    Yes, you can have the long filenames in a symbol catalog just fine, it is just the symbol name that is the issue. The problem really occurs here because CC3+ automatically generates symbol names from file names, and if the file names are too long, it just truncates the file names.

    The annoying part of handling this when making symbol catalog is that you can't simply import a folder full of png's and let everything happen automatically. What you have to do is to import the folder. Then go into symbol manager, rename the symbols that would have conflicting names (i.e. the same first 31 characters), then import the folder again (with the Update option and not Rebuild set). You will have to repeat this as many times as you have duplicate names, so if 10 symbols share the first 31 characters, it's doing this loop 10 times :(

    Of course, if you have multiple groups with conflicting names, you handle 11 symbol from each group for each loop and not just a single symbol.

    Fortunately, while this can be a bit frustrating, it is only when making the symbol catalog. And you don't need to touch the file names, meaning that if you put the collection inside your data directory before starting and then use relative paths for the file names, others could use the same catalogs too (which is why doing these things as a community project may pay off)

  • edited October 2020

    When I've created symbol catalogues (been doing it a lot recently), it shortens long filenames by cutting the later characters and so you still lose the "duplicates."

    It's immediately obviously from the pop-up message that some of the files have been missed though, so you are at least aware of the clash.

    EDIT: Beaten by a much better answer by Monsen.

    I'd say that you're better off just bulk renaming the files. Even if you plan to keep updating from the google drive copy of those files, you're likely to be able to find a way to automate a bulk rename when making you local copy more easily than doing it within CC3.

Sign In or Register to comment.