Skip to content

Configuration option to keep the zoomed image from growing to larger than its largest sizeย #216

Open
@gingersoulrecords

Description

@gingersoulrecords

The problem

When I apply medium-zoom to all images in my (blogging) application, some images are smaller than the viewport at their largest size, but get zoomed to fit the viewport, which causes them to be blurred.

Solution

I would like a config option to 'cap' the image scale to the native width/height of the image (per its width/height attributes), keeping it vertically and horizontally centered above the overlay. If it's larger than the viewport, fill the viewport, but don't zoom it past its 'largest' size.

Implementation

Include the imageโ€™s width/height attributes in the scale math so that it scales up to its largest native size if it's smaller than the current viewport.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions