mwaterfall / MWPhotoBrowser

A simple iOS photo and video browser with grid view, captions and selections.
MIT License
8.75k stars 2.71k forks source link

<Error>: CGAffineTransformInvert: singular matrix. #334

Open zhugexiaobo opened 9 years ago

zhugexiaobo commented 9 years ago

I found this error in iOS 8 when sliding the 3rd image to 4th, <Error>: CGAffineTransformInvert: singular matrix.. Then it can't move to next/prev image.

At 5s and above, this error shows but image can be moved to next.

nicorsm commented 9 years ago

Also found this problem with local images on iPhone 5s/iOS 8.0.1

surendraraju commented 9 years ago

In the class MWZoomingScrollView.m , method showLoadingIndicator set

self.zoomScale = 0.1;
self.minimumZoomScale = 0.1;
self.maximumZoomScale = 0.1;

This will get rid of that error .

mythodeia commented 9 years ago

@surendraraju this works for me as well

faacsousa commented 9 years ago

This works for me as well. Will that be updated in master?

luutruong commented 9 years ago

The currently version did not fix it :)

aravindkumar commented 9 years ago

Same issue in ios8.4

aravindkumar commented 9 years ago

Same issue is occurred in ios 8.4

xilin commented 9 years ago

It still shows the error now.

unbirdlikebird commented 8 years ago

also ios9

ignus001 commented 8 years ago

I found this error while setting navigation controller's viewcontroller stack. navigationController?.setViewControllers(stack, animated: true) where stack is an array of UIViewControllers and MWPhotoBrowser is on top (last on stack)

Stack:

[AppName.MenuSelectionViewController: 0x7be154b0,AppName.AboutRootViewController: 0x7be0cb80,MWPhotoBrowser: 0x7c104c00]

ignus001 commented 8 years ago

Fixed by doing this.

         if stack[stack.count-1].dynamicType == MWPhotoBrowser.self{
            var newstack : [UIViewController] = []
            for (var x = 0 ; x < stack.count; x++){
                if x != stack.count-1{
                    newstack.append(stack[x])
                }
            }

            navigationController?.setViewControllers(newstack, animated: false)

            let nav = UINavigationController(rootViewController: stack[stack.count-1])
            nav.modalTransitionStyle = UIModalTransitionStyle.CrossDissolve
            presentViewController(nav, animated: true, completion: nil)
        }else{
            navigationController?.setViewControllers(stack, animated: true)
        }

Creating a new stack minus the MWPhotoBrowser, setViewController unanimated, then manually adding the MWPhotoBrowser on the new stack using

            let nav = UINavigationController(rootViewController: stack[stack.count-1])
            nav.modalTransitionStyle = UIModalTransitionStyle.CrossDissolve
            presentViewController(nav, animated: true, completion: nil)

works on iOS9, XCode 7.2.1

PedroAnibarro1 commented 8 years ago

I fixed the error by doing what @surendraraju said. Although, I'm still having the issue that @zhugexiaobo have of not being able to swipe to next/prev image.

This happens to me when importing photos using DKImagePickerController pod. When the user finishes selecting photos and importing them, I refresh my MWPhotoBrowser and this happens. When I select one of the just imported photos, the last not imported photo appear instead of the selected imported photo. Any ideas?

joyfementira commented 7 years ago

@surendraraju , How can i implement that code? Where i can find the those class and method?

surendraraju commented 7 years ago

@joyfementira Go to the class file MWZoomingScrollView.m , if you don't know where the class is , use search option in the navigation area of the Xcode IDE. And go to the instance method showLoadingIndicator, you can search for it as well. And replace the above given code with first 3 lines of that method.