$powReduce = 1;
} else if (4 == $scale) {
$powReduce = 2;
+ } else if (8 == $scale) {
+ $powReduce = 3;
+ } else if (16 == $scale) {
+ $powReduce = 4;
+ } else if (32 == $scale) {
+ $powReduce = 5;
} else {
- // $$$ why do we default to such a small scale?
+ // $$$ Leaving this in as default though I'm not sure why it is...
$scale = 8;
$powReduce = 3;
}
if (1==this.mode) {
var url = 'http://'+this.server+'/GnuBook/GnuBookImages.php?zip='+this.zip+'&file='+file+'&scale='+this.reduce;
} else {
- var ratio = this.getPageHeight(index) / this.twoPageH;
+ var ratio = this.getPageHeight(index) / this.twoPage.height;
var scale;
// $$$ we make an assumption here that the scales are available pow2 (like kakadu)
if (ratio <= 2) {
scale = 1;
} else if (ratio <= 4) {
scale = 2;
- } else {
+ } else if (ratio <= 8) {
scale = 4;
- }
+ } else if (ratio <= 16) {
+ scale = 8;
+ } else if (ratio <= 32) {
+ scale = 16;
+ } else {
+ scale = 32;
+ }
var url = 'http://'+this.server+'/GnuBook/GnuBookImages.php?zip='+this.zip+'&file='+file+'&scale='+scale;