0

When Galleria is in fullscreen mode, I want it to display images pixel-for-pixel, i.e. with no scaling at all.

My initial plan was to do this by both:

  • using fullscreenCrop: false, because the docs say that, "false will scale down so the entire image fits", and
  • ensuring (I already have a mechanism for doing this) that the "big" image file's:
    • height (px) ≦ the screen's height (px) and
    • width (px) ≦ the screen's width (px).

Unfortunately:

  • the docs neglect to note that "false will also scale up so the entire image fits" (i.e. if both the image's height (px) < the screen's height (px) and the image's width (px) < the screen's width (px)), and
  • I do not have, nor do I want to have, a mechanism for ensuring that the "big" image file's
    • height (px) = the screen's height (px) or
    • width (px) = the screen's width (px).

Given all this, please can you suggest how I might achieve my objective?

  • @David, before you posted this comment, and indeed within a second of being able to do so, I had already accepted your answer below. I don't think I could really have accepted it at a faster rate! –  Jan 14 '13 at 21:26
  • 1
    Yea, that’s great but you should also accept some of your other questions as your general rate (61%) is pretty low. The higher rate you have, the more likely you will get quality answers. – David Hellsing Jan 14 '13 at 22:11
  • 1
    @David, thanks for the tip. I realise you're trying to help me. Nevertheless, I tend to only accept answers that I'm confident are definitively correct, because I believe that to be more important than worrying about a comparatively arbitrary statistic. Thanks again, though. –  Jan 15 '13 at 00:09

1 Answers1

2

You can prevent scaling by adding these two options:

maxScaleRatio: 1
minScaleRatio: 1

You probably only need the first one to prevent upscale. But the second one prevents downscale as well. Read more: http://galleria.io/docs/options/maxScaleRatio/

David Hellsing
  • 106,495
  • 44
  • 176
  • 212