Git Product home page Git Product logo

imageviewer's People

Contributors

aashishdhawan avatar delfes avatar ealeksandrov avatar elegwance avatar humblehacker avatar iainsmith avatar ivopintodasilva avatar jesalgadom avatar jfahrenkrug avatar joeferrucci avatar johnprog avatar kellyroach avatar kozyty avatar krisiacik avatar kvnhm avatar lucascoelho avatar mergesort avatar mezhevikin avatar miex0r avatar mluisbrown avatar nonepse avatar oxozle avatar readmecritic avatar ricardopereira avatar ruiaaperes avatar sebastianthiebaud avatar siemian avatar tc-sgupta avatar woko666 avatar zfoltin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imageviewer's Issues

How to pass image into the ImageView?

Hello,

By refer to your code, I wonder how I can pass my selected Image to display?

class PoorManProvider: ImageProvider {

    func provideImage(completion: UIImage? -> Void) {
        completion(UIImage(named: "image_big"))
    }
}

Image does not displace from parent view

I'm facing a problem with the image viewer using the following configuration:

let configuration: GalleryConfiguration = [
            /// presentation style
            GalleryConfigurationItem.presentationStyle(.displacement),
            GalleryConfigurationItem.statusBarHidden(true),
            
            /// top buttons
            GalleryConfigurationItem.thumbnailsButtonMode(.none),
            GalleryConfigurationItem.closeLayout(.pinRight(30, 30)),
            GalleryConfigurationItem.closeButtonMode(.custom(closeButton)),
            
            /// displacement technique
            //GalleryConfigurationItem.displacementKeepOriginalInPlace(false),
            GalleryConfigurationItem.displacementInsetMargin(20),
            GalleryConfigurationItem.displacementDuration(0.5),
            GalleryConfigurationItem.displacementTimingCurve(.easeInOut),
            GalleryConfigurationItem.reverseDisplacementDuration(0.5),
            
            /// disable fade and blur
            GalleryConfigurationItem.overlayBlurOpacity(0),
            GalleryConfigurationItem.itemFadeDuration(0),
            
        ]

When I press the close button, I want my image to be displaced into its original position of the parent view. However, this is not happening. The image viewer simply closes and shows the parent view abruptly without any kind of animation.

I have disabled fade and blur on purpose to show only the image displacement when closing the viewer.

Am I missing something here?

What to do with legacy API for 1 image?

Now that we have codebase to support multiple images that required to create slightly different API, there is a question of what to do with legacy API.

Shall we

  1. create a separate git repo and keep this ImageViewer one as is?
  2. keep both classes (viewer and gallery) in the project so the gallery would be pure addition?
  3. Keep the legacy API signatures but make them call the new gallery codebase behind the scenes?
  4. Other approach?

Builtin close button assets missing

button.setImage(UIImage(named: "close_normal"), forState: UIControlState.Normal)
button.setImage(UIImage(named: "close_highlighted"), forState: UIControlState.Highlighted)

Podspec doesn't add any assets. When I manually copied them from demo project it worked.

Idea - maybe draw it programmatically instead of using images?

Reverse presentation animation?

Hi, I'm wondering if there is a way to reverse the initial animation that opens up the viewer. I have an image that grows nicely onto the screen, and I'd like the dismiss animation to reverse that and shrink the image down to its original location. Is this possible?

Wrong version in .podspec file for v3.0

It seems it's not possible to install the version 3 via cocoapods?
The .podspec of v3 points to v2.0.

I also used this line:
pod 'ImageViewer', :git => '[email protected]:MailOnline/ImageViewer.git', :tag => '3.0' or
pod 'ImageViewer', :git => '[email protected]:MailOnline/ImageViewer.git', :commit => 'f887383cc4fc32374f4096329253b2df5a79c11a'

but it produces strange error:
GalleryViewController.swift:367:36: Use of unresolved identifier 'ThumbnailsViewController'.
Any ideas?

presenting displaced view maintains its image size, does not fit to new ImageView bounds

Hello, when passing a UIImageView (which has a contentMode of .ScaleAspectFit) as a displaced view, GalleryViewController maintains the image size. If the image is fit by height it maintains the aspect ratio and does not layout to the new bounds.

passing first image as displaced:

switching to next image:

passing second image as displaced:

switching to first image:

Versioning

Why 2-part version numbers are used? Why not classic semantic versioning?

If there is no apparent reason to keep it - I suggest using full MAJOR.MINOR.PATCH in future releases:

MAJOR - breaking API change
MINOR - new features added
PATCH - bugfixes without breaking any public API

Zooming bug on some devices/images

In some cases with some devices (i.e: iPhone 7plus simulator and image 7/7 of the example), the return from AVMakeRectWithAspectRatioInsideRect in aspectFitContentSize: has some decimals that makes this comparison to be false, provoking a bug when zooming in.

Using floor() for this comparison makes the trick. I already created the fix on my fork. Let me know if you agree and want me to create a PR to master.

How to add a button in header or footer view?

Thanks for a super framework - I am stuck on how to add a button as the footer to allow me to fetch a hi-res version of the photo on the screen. I have followed the example of CounterView and I can make the button appear as a Decoaration (footerView) but it is not clickable. Could you pls post a snippet or explanation of how to do this - thanks

Cannot use with pod

I add pod "ImageViewer" to pod file, make pod install and it installs. After that how to use ImageViewer class if there is no module to import and it does not see ImageViewer class?

Spinner

Hey, I see some config items for spinner customization, but don't actually see it in my application. More than that - I can't find any code related to UIActivity or spinner config items.

Gallery expansion

ImageViewer is going to evolve to a full fledged Gallery.

Requirements:

Visual transition from article to gallery should match the experience provided by ImageViewer so far i.e. using the displacement effect.

The gallery will have these view elements

image counter (positioned in the top middle)
close button (top right)
caption (on top of social share sheet)
social share sheet (bottom)

horizontally paging images (in the middle)

  1. all the components above except the images will be global to the Gallery..that means when while we page from image to another image, these components will not scroll as they will not be part of the scrollview but instead their parent will be the Gallery(controller) itself.

root
-> common views
-> paging (scrollview with images...or similar)

  1. Single tap on the canvas will hide or show all the common view from above. Another one will unhide them again.
  2. We will be able to dismiss the gallery either by tapping Close button or vertically swiping the currently selected image out of screen bounds. When closed by Close button, there is a problem that the displaced image might not be the same we are closing with. In this case we will use a crossdisolve effect and just fade into main screen.
  3. Image counter is a simple "I from N" ....label where I is index of Image and N is number of images.
  4. The caption and social share sheet will copy MailOnline app style.
  5. the transition of caption content will be done in "fade out - fade in" fashion matching the horizontal image paging offset
  6. If we will use it, we might take advantage of a UIPageViewController feature called spine - which is really simple..it allows to set a custom distance between pages..so when you scroll/page..images do not completely touch each other, there is a certain margin between them.

Update cocoapods build with latest from repo

It seems as if the version that is coming from cocoapods is an old version of ImageViewer.

With xcode 8, i'm forced to Swift 2.3 and the new version of ImageViewer can handle this.

My workaround is using this in my PodFile

pod 'ImageViewer', :git => 'https://github.com/MailOnline/ImageViewer.git'

but then this has an issue with missing file ThumbnailsViewController.swift and ThumbnailCell.swift

Log for VideoScrubber

I always see

VideoScrubber deinit 💣

on ImageViewer dismissing. Even when there are no videos in gallery. This is too verbose/unneeded log for me and most of users.

Improve README

I see verbose log of version changes and no instructions for quick start.

I propose moving changelog to CHANGELOG.md and adding quick start section with minimal instructions and delegate example for mix of local and remote images.

Swift 3

compatibility with swift 3

Add thumbnails Grid View

For galeries with dozens of images a grid like special view with thumbnails would keep UX fine.
One thing would have to be ensured. Some kind of mutually exclusive layout logic between the close button and thumbnails button.

Fullscreen gallery on not fullscreen modal view controller

Hey guys!

I've been using your lib a lot and I ran into a small issue (for my purposes).
I want to display the gallery from a not-fullscreen modal view controller. However, when I tried to do this, the blur view only covered that same view controller and left the rest of the screen visible.

I found out that it was happening because the blur view is being added to the parent view controller, so it keeps the size of the parent.

To fix this I added the blur view to the back of the gallery instead, this way occupying the whole screen.

Is this the "correct" behaviour for the gallery and should I open a Pull Request or the current behaviour is best?

Cheers! 🍻

Type 'ImageViewer' has no member 'GalleryViewController'

The project where I'm working now already has an GalleryViewController type 😁
So I forced to use the correct GalleryViewController type calling it explicitly with the module name ImageViewer like

let imageGallery = ImageViewer.GalleryViewController(imageProvider: imageProvider, displacedView: collectionView.cellForItemAtIndexPath(indexPath), imageCount: collectionDataSource.data.count, startIndex: index)

but then the compiler generates this error:
"Type 'ImageViewer' has no member GalleryViewController".

Any workaround? (maybe using a class prefix?)

ImageViewer that is never presented will crash on deinit

If an ImageViewer is created but never presented, its various view properties, namely scrollView, will never be initialized, and so will crash the app in deinit when scrollView.removeObserver(self, forKeyPath: "contentOffset") is called. Simply changing the deinit to scrollView?.removeObserver(self, forKeyPath: "contentOffset") fixes the issue.

How to add videos in .carusel?

Hello!

Faced a feature today, but no idea how to make it real.. In standard Apple "Photos".app we can swipe like carusel(thnx for this!) and sometimes can swipe it till video-files... How did they managed to do this and how to implement it in this library? Also will be a great enhancement to library as well in general...

Remove image from gallery

How is it possible to remove an image from the gallery using a "Delete Button" e.g. in the footer view similar to a "Close Button"?

No CounterView

Do u guys know that there is no CounterView class in imageView framework. However there is line using this class in Readme.md

Displacement view and swipe to dismiss

Hey, first of all, great library and also being developed rapidly.

Here is a little question. I am using displacement views and if I close the gallery by tapping on close button - the gallery is closed correctly and the image is animated back to displaced view.

BUT if I close the gallery with swipe gesture - it is simply going out of the screen without returning to displaced view.

Any fix for this? Or ImageViewer does not have this feature yet?

First Image in array does not appear right away.

Hi, when the images are provided by a multiple image picker such as BSImagePicker ([https://github.com/mikaoj/BSImagePicker]) , the first image does not load until the first page is reloaded via scrolling a few images over then back. Any idea as to a fix? I feel like it has to do with the initial animation for the displaced view, which I have tried to disable, but still didn't fix the issue. Thanks for your time!

README.md

Can you guys please update
The swift version right now is 2.3. Stay tuned for 3.0.

I think it is already swift 3?

Async Image loading

Hello!
I am trying to show a very big (panorama) image in carusel and every time I swiping to this image it loads too long... The main thread is blocking by it, wondering about using this pod with ASDK from Facebook, but may be any other solutions?

If I want to modyfy the UIImageView of this where should I "dig"?

Tnx anyway

Solved by using ASImageNode from ASDK(google it) replacing UIImageView

Configurable ImageView

I've been using Kingfisher as my image loading dependency alongside its AnimatedImageView which adds support for GIF loading.

As such, in order to take advantage of this in ImageViewer I had to make the imageView property public in the ImageViewerController class.

As this might be a problem for other people using different dependencies, might be nice to get this change into the library.

I've forked the project and made the change myself, let me know if it makes sense to open a pull request.

Example usage:

let buttonAssets = CloseButtonAssets(normal: closeIcon,
                                         highlighted: closeIcon)
let configuration = ImageViewerConfiguration(imageSize: CGSize(width: 10, height: 10),
                                                 closeButtonAssets: buttonAssets)
let imageViewer = ImageViewerController(imageProvider: viewModel, configuration: configuration,
                                            displacedView: view.imageView)
let imageView = AnimatedImageView()
imageView.framePreloadCount = 1
imageViewer.imageView = imageView
presentImageViewer(imageViewer)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.