Bad dimensions fix?

Make art for user-made content.

Moderator: Forum Moderators

Forum rules
Before posting critique in this forum, you must read the following thread:
Post Reply
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Bad dimensions fix?

Post by vghetto »

Hi,

With my port project I'm coming up against a lot of bad dimension images such as

Code: Select all

Detected an image with bad dimensions: units/monsters/fireghost-death6.png: 70x70
It will not be masked, please use: 72x72
Is there a quick way of fixing these from the command line say with imagemagick?
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2337
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Bad dimensions fix?

Post by Lord-Knightmare »

vghetto wrote: December 3rd, 2021, 9:05 pm Hi,

With my port project I'm coming up against a lot of bad dimension images such as

Code: Select all

Detected an image with bad dimensions: units/monsters/fireghost-death6.png: 70x70
It will not be masked, please use: 72x72
Is there a quick way of fixing these from the command line say with imagemagick?
Just open the image and resize to 72x72. Also that graphic is still in core maybe so maybe just change the path to the core one?
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Bad dimensions fix?

Post by vghetto »

Lord-Knightmare wrote: December 3rd, 2021, 9:42 pm Also that graphic is still in core maybe so maybe just change the path to the core one?
Ha!
I thought the mod had this image. When you said core has it, I found it strange that it didn't complain about file conflicts.
Turns out wesnoth was complaining about the bad dimensions in the core image! :lol:
Maybe a bug report should be opened about it.
User avatar
octalot
General Code Maintainer
Posts: 777
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Bad dimensions fix?

Post by octalot »

It seems there's no error message when spawning and killing Fire Guardians (the unit whose death animation uses that image). Is the mod doing something more with it, such as using an image path function?
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Bad dimensions fix?

Post by vghetto »

Yeah, it's adding them to the map as an item.
I just checked the files in core for 1.14 and 1.16. They are 70x70.

The mod in question is Brave_Wings

Code: Select all

#define BW_FG_APPEARANCE X Y
    [item]
        x,y={X},{Y}
        image=units/monsters/fireghost-death6.png
    [/item]
    {BW_DELAY 75}
    [remove_item]
        x,y={X},{Y}
        image=units/monsters/fireghost-death6.png
    [/remove_item]
   
...
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Bad dimensions fix?

Post by vghetto »

I guess a possible quick command-line fix for this general situation would be something like:

Code: Select all

wesnoth --render-image "misc/blank-hex.png~BLIT(units/monsters/fireghost-death6.png)" fixed_dimensions.png
Given that the broken dimensions are less than 72x72.
User avatar
doofus-01
Art Director
Posts: 4121
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: Bad dimensions fix?

Post by doofus-01 »

It has been a limitation of [item] 'image' key that images can't spill out of the hex, possibly "72x72" isn't strictly accurate (I don't know the code, just the usage). If you want a bigger (or animated) image, it needs to be in the 'halo' key, which isn't perfect either, so then you can use terrain graphics.

You can get a similar error by using a too-large image for a map editor button/icon.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Post Reply