Prefer memory-mapped files for large images

Okay here’s the original problem I was having.

Line 423 of ImageUtils.java:
int method = instance.largeImageLoadMethod;

method is always 0 whether the box for “Prefer memory-mapped files for large images” is checked or not. It is always MAPPED. Preferences appear to be loading properly as the option is always in the same state as the last close. Is largeImageLoadMethod being set to the correct value when preferences are loaded?

  • M.

Fixed in mkiefte-ADC2-import r3098. The property change listener was
called only if the check box was TRUE. Because MAPPED is 0, the only
possible value for largeImageLoadMethod was 0. The constructor for
ImageUtils now sets it to RAM and the property change listener will
set it back to MAPPED if the box is checked on loading preferences.

With this and Joel’s fix it’s like running a whole new program. My
laptop is slow, but it’s got gobs of RAM.

  • M.

On 17/02/2008, mkiefte messages@forums.vassalengine.org wrote:


Michael Kiefte, Ph.D.
Associate Professor
School of Human Communication Disorders
Dalhousie University
Halifax, Nova Scotia, Canada
tel: +1 902 494 5150
fax: +1 902 494 5151


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

It would appear that this problem is also true for scalingQuality. The
only valid values are GOOD (2) and MEDIUM (1). However, is
initialized by default to 0 and if the box is unchecked at startup,
that is the value it will have. Otherwise it will be GOOD. It will
only ever be MEDIUM if the user unchecks that option after startup –
similar to the largeImageLoadMethod option before the fix.

I was going to commit a change, but there’s a section of code starting
on line 89 that might need to be run from within the constructor –
I’m not sure.

I’ll let Joel take care of that one.

  • M.

On 17/02/2008, Michael Kiefte mkiefte@dal.ca wrote:


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

Thanks for catching that. I think that setting initial values for
largeImageLoadMethod and scalingQuality where they’re declared is
enough to fix all of this.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thanks.

  • M.

Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)