Skip to content

Image shrinks randomly when swiping between photos in fullscreen mode (iOS, ImageViewer.swift 3.3.8) #152

@nusjeff

Description

@nusjeff

📌 Description

Hi team,
I'm experiencing an issue where images randomly shrink (become smaller / squeezed) when the user is in fullscreen mode and swipes left–right between images.

This happens consistently on certain images, and it looks like the viewer resets the contentMode or zoom scale incorrectly during paging.

This issue occurs on:

  • UIImageView.setupImageViewer(...)
  • Version 3.3.8
  • Swift version: Swift 5.10
  • Xcode: Xcode 16.2

📱 Environment

Component Version
iOS Version iOS 17.5
Device iPhone 14 / iPhone 16 Pro (real device + simulator)
Swift 5.10
Xcode 16.2
ImageViewer.swift 3.3.8
Installation CocoaPods

Podfile entry:

pod 'ImageViewer.swift', '~> 3.3.8'
pod 'ImageViewer.swift/Fetcher', '~> 3.3.8'

🧪 What I Have Tried

I attempted several fixes on the thumbnail image before launching the viewer:

listingImage.contentMode = .scaleAspectFit
containerView.clipsToBounds = true
containerView.contentMode = .center

But the issue still persists, and the fullscreen viewer continues to resize some images incorrectly while swiping.

📸 Code Example

galleryImage.setupImageViewer(
    urls: urls,
    initialIndex: urls.firstIndex(of: url) ?? 0,
    options: [
        .theme(.dark),
        .closeIcon(R.image.xClose()!),
        share
    ]
)

❗ Issue Behavior

🔄 Expected

  • When swiping left/right, each image should display at a consistent scale (respecting aspect fit).

💥 Actual

  • Some images suddenly shrink, appearing smaller than others.
  • This happens randomly while swiping between fullscreen images.

🎥 Video screen

[

Screen.Recording.2025-12-04.at.8.35.55.AM.mov

](url)

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