Bug in _fitToViewport
  • There's a bug in _fitToViewport which makes large photos look really weird, I'm really surprised it's not mentioned on these forums.

    Line 592, after determining new container dimensions for resized photos, fitToViewport calls itself with dimensions of the container (as if container was the image itself) instead of using resized image dimensions which are smaller. The result is an image with wrong aspect ratio.
    The line 592 should be:
    _fitToViewport(imageWidth,imageHeight)

    and NOT _fitToViewport(pp_containerWidth,pp_containerHeight)
  • Hi,
    I'm using the prettyPhoto Media plugin. The code is a bit different but I think the problem stays the same. Would you happen to know what is the fix in this version?
    Thx
  • Oh, zgollum, thank you for this tip! Was unpleasantly surprised with this bug after upgrading to the latest version of PrettyPhoto.
  • Many thanks zgollum, it works !

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter