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 28 Mar 2011 02:26:29 PM UTC  
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 29 Jan 2012 09:58:53 PM UTC, 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 29 Jan 2012 09:51:27 AM UTC, 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 27 Jan 2012 09:04:55 AM UTC, comment #18:

Also attaching a 1.8 screenshot for reference.

(file #14842)

Ignacio R. Morelle <shadowmaster>
Project Administrator
Fri 27 Jan 2012 08:57:28 AM UTC, 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 23 Jan 2012 12:10:51 AM UTC, 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 23 Jan 2012 12:07:52 AM UTC, comment #15:

Sounds like a duplicate of bug #18686.

Nils Kneuper <ivanovic>
Project Administrator
Sat 17 Dec 2011 07:01:19 PM UTC, 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 12 Dec 2011 01:55:03 AM UTC, 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 11 Dec 2011 09:55:22 PM UTC, 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 11 Dec 2011 05:07:58 PM UTC, 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 11 Dec 2011 03:56:51 PM UTC, 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 10 Dec 2011 08:55:58 PM UTC, 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 09 Nov 2011 04:08:45 PM UTC, 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 05 Apr 2011 06:21:50 PM UTC, 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 04 Apr 2011 12:51:51 AM UTC, 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 02 Apr 2011 01:29:45 PM UTC, comment #5:

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

Fri 01 Apr 2011 01:34:49 PM UTC, 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 31 Mar 2011 10:42:27 PM UTC, comment #3:

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

Ignacio R. Morelle <shadowmaster>
Project Administrator
Thu 31 Mar 2011 10:38:10 PM UTC, 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 31 Mar 2011 08:44:19 PM UTC, 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 28 Mar 2011 02:26:29 PM UTC, 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 29 Jan 2012 09:16:49 PM UTCshadowmasterStatusPostponed=>None
    Fri 27 Jan 2012 09:04:55 AM UTCshadowmasterAttached File-=>Added map-scaling-wesnoth-1.8.jpg, #14842
    Fri 27 Jan 2012 08:57:28 AM UTCshadowmasterAttached File-=>Added map-scaling-wesnoth.jpg, #14840
      Attached File-=>Added map-scaling-gimp-linear.jpg, #14841
    Mon 23 Jan 2012 12:10:51 AM UTCivanovicSeverity5 - Blocker=>4 - Important
    Mon 23 Jan 2012 12:07:52 AM UTCivanovicStatusReady For Test=>Duplicate
    Sat 10 Dec 2011 08:57:36 PM UTCmordanteStatusNone=>Ready For Test
    Wed 09 Nov 2011 04:08:45 PM UTCai0867Severity4 - Important=>5 - Blocker
    Thu 31 Mar 2011 08:44:19 PM UTCmordanteAssigned toNone=>mordante
    Mon 28 Mar 2011 08:28:49 PM UTCshadowmasterSeverity3 - Normal=>4 - Important
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup