bugBattle for Wesnoth - Bugs: bug #17961, portaits scaled badly in dialogue

Show feedback again

bug #17961: portaits scaled badly in dialogue

Submitted by:  None
Submitted on:  Mon Mar 28 14:26:29 2011  
Category: BugSeverity: 4 - Important
Priority: 5 - NormalItem Group: Graphics
Status: NonePrivacy: Public
Assigned to: Mark de Wever <mordante>Originator Email: -unavailable-
Open/Closed: OpenRelease: 1.9.5
Operating System: linux

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Sun Jan 29 21:58:53 2012, comment #20:

There are 4 scaling-related bugs:

  • Portraits get scaled when they don't need to be.
    • Fixed in r52205.
  • Portraits get scaled rather than cropped above 500px when there's no room.
    • No other bug filed.
  • Too-large portraits occasionally crash the game.
  • Misuse of scaling algorithms.
    • Minimap should not use interpolation, main menu background, story art and portraits should. (main menu is broken, not sure about the rest)
    • No other bug filed.
Alexander van Gessel <ai0867>
Project Member
Sun Jan 29 09:51:27 2012, comment #19:

Shadowmaster as said on IRC I consider the image scaling algorithm problem not as part of this bug, but see it as a separate issue.

Mark de Wever <mordante>
Project MemberIn charge of this item.
Fri Jan 27 09:04:55 2012, comment #18:

Also attaching a 1.8 screenshot for reference.

(file #14842)

Ignacio R. Morelle <shadowmaster>
Project Administrator
Fri Jan 27 08:57:28 2012, comment #17:

I just realized that the scaling algorithm also makes the titlescreen background look terrible with jagged text edges on 800x600 (I normally use 1280x800, which displays a completely unrelated problem).

Attached a screenshot of the titlescreen on 800x600, and a version of the titlescreen background scaled using the GIMP's Linear scaling method.

(file #14840, file #14841)

Ignacio R. Morelle <shadowmaster>
Project Administrator
Mon Jan 23 00:10:51 2012, comment #16:

Espreaon just mentioned that it is not a dupe, so marking it as postponed till past 1.10 is branched off...

Nils Kneuper <ivanovic>
Project Administrator
Mon Jan 23 00:07:52 2012, comment #15:

Sounds like a duplicate of bug #18686.

Nils Kneuper <ivanovic>
Project Administrator
Sat Dec 17 19:01:19 2011, comment #14:

I talked with Jetrel regarding the wishes of the portraits before coding. In
the original specification, there was only the wish to scale portraits, not to
crop them. So I designed the engine according to these specifications.

So at the moment it needs quite a bit of work to change how it works. Since
there are a lot of other GUI2 things to be done, this has a low priority for
me. Also I don't consider it a bug.

Mark de Wever <mordante>
Project MemberIn charge of this item.
Mon Dec 12 01:55:03 2011, comment #13:

That may be true, but rithrandil was designed against the spec I described, which was an idea to make huge units look that way without noticeable cropping. (if the screen is tall, you can show the whole portrait. If it's short you can crop anything above 500px)
It's not very important for 1.10, but it was a spec that the artists rather liked.

Alexander van Gessel <ai0867>
Project Member
Sun Dec 11 21:55:22 2011, comment #12:

I designed the dialog to only scale and not to crop, so the fact that rithrandil is scaled on several screens is by design.

Mark de Wever <mordante>
Project MemberIn charge of this item.
Sun Dec 11 17:07:58 2011, comment #11:

Portraits are still scaled on 1024 pixel-wide screens, but I guess there's not much that can be done about that.

On <700 pixel tall screens that are wide enough for 500 pixel wide portraits, rithrandil is still scaled though. The idea was that everything above 500px that doesn't fit is allowed to be cropped.

Alexander van Gessel <ai0867>
Project Member
Sun Dec 11 15:56:51 2011, SVN revision 52235:

Add test case for bug #17961 and bug #18686 to test scenario

(Browse SVN revision 52235)

Alexander van Gessel <ai0867>
Project Member
Sat Dec 10 20:55:58 2011, SVN revision 52205:

Shows of big portraits on smaller screens.

The code might need some polishing later on, but seems to work now.
(Fixes bug #17961 and #18686.)

(Browse SVN revision 52205)

Mark de Wever <mordante>
Project MemberIn charge of this item.
Wed Nov 9 16:08:45 2011, comment #8:

Bumping up to blocker as we do not want to release 1.10 with portraits looking like this.

Alexander van Gessel <ai0867>
Project Member
Tue Apr 5 18:21:50 2011, comment #7:

Reading a commit shadowmaster linked to [1], it appears the max width is now screen_width/3. Which may be more reasonable than 500px, but is probably what causes the scaling at smaller resolutions. (1024px wide -> scales everything wider than 341px, which is just about everything)

[1] http://svn.gna.org/viewcvs/wesnoth?view=rev&rev=47766

Alexander van Gessel <ai0867>
Project Member
Mon Apr 4 00:51:51 2011, comment #6:

There are two issues here:
1. Portraits are scaled when there is no need to do so. This was probably introduced along with extremely tall portraits (> 500 px, like the wose) as a temporary fix. Wanted behavior:
-Scale down to 500px wide if wider.
-Crop down to screen height if (still) too tall.

2. The scaling algorithm messes up the minimap by sampling from pixels not in the hex. The scaling algorithm was then re-broken to fix this, which re-worsened any scaling for portraits and such.

So, fixes that are needed:
1. Change GUI2 to make portraits work as wanted.
2. Specialize the scaling algorithm to work for the minimap, then re-enable the proper sampling.

Alexander van Gessel <ai0867>
Project Member
Sat Apr 2 13:29:45 2011, comment #5:

OK, mordante was right, that's what it was. See:

Fri Apr 1 13:34:49 2011, comment #4:

OK, I think I understand:

A. Dec. 10th -> 1.9.3

B. Dec. 19th -> r47967

C. Jan. 17th -> 1.9.4 -> Did r47967 make the portraits smoother in 1.9.4 than they were in 1.9.3?

D. March 12th -> r47967 is undone, hard edges restored for editor

E. March 27th -> 1.9.5 -> Did action "D" make 1.9.5 have same portraits as 1.9.3?

I'll have to re-install 1.9.3, so I don't yet know. But AI (in my forum link below) said the portraits should not be getting scaled at all for normal screen sizes, so isn't the real problem older than 1.9.3?

Thu Mar 31 22:42:27 2011, comment #3:

I think he meant http://forums.wesnoth.org/viewtopic.php?p=481831#p481831 .

Ignacio R. Morelle <shadowmaster>
Project Administrator
Thu Mar 31 22:38:10 2011, comment #2:

There must be a typo in your link, mordante, it leads to a 2004 post about ghosts. I didn't notice much of a difference between 1.9.3 and 1.9.4, but I will check. What I did notice was:
1.9.2 vs 1.9.3, images got scaled down
1.9.4 vs 1.9.5, image quality decreased

- doofus-01

Thu Mar 31 20:44:19 2011, comment #1:

There have been changes in the size of the scaling between 1.9.3 and 1.9.4, which can cause the size reduction.

The quality reduction might be caused by [1]. When looking at an image in 1.9.3 and 1.9.5. scaled down to the same size does the quality then also degrade?

[1] http://forum.wesnoth.org/viewtopic.php?f=5&t=3284&start=15#p481831

Mark de Wever <mordante>
Project MemberIn charge of this item.
Mon Mar 28 14:26:29 2011, original submission:

Starting in 1.9.3, the portraits got scaled down severely, at least for some screen sizes. In 1.9.5, the scaling method degrades the images more than it did in 1.9.3 and 1.9.4. But they should not get scaled at all? Please see forum post:



(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by ivanovic (Posted a comment)
  • -unavailable- added by ai0867 (Posted a comment)
  • -unavailable- added by mordante (Posted a comment)
  • -unavailable- added by shadowmaster (Updated the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Jan 29 21:16:49 2012shadowmasterStatusPostponed=>None
    Fri Jan 27 09:04:55 2012shadowmasterAttached File-=>Added map-scaling-wesnoth-1.8.jpg, #14842
    Fri Jan 27 08:57:28 2012shadowmasterAttached File-=>Added map-scaling-wesnoth.jpg, #14840
      Attached File-=>Added map-scaling-gimp-linear.jpg, #14841
    Mon Jan 23 00:10:51 2012ivanovicSeverity5 - Blocker=>4 - Important
    Mon Jan 23 00:07:52 2012ivanovicStatusReady For Test=>Duplicate
    Sat Dec 10 20:57:36 2011mordanteStatusNone=>Ready For Test
    Wed Nov 9 16:08:45 2011ai0867Severity4 - Important=>5 - Blocker
    Thu Mar 31 20:44:19 2011mordanteAssigned toNone=>mordante
    Mon Mar 28 20:28:49 2011shadowmasterSeverity3 - Normal=>4 - Important
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup