Comments (7)
Hey. I couldn't reproduce this crash here.
But I didn't understand one thing: how the performCloseAnimationWithScrollView: method was called, since its only called to dismiss images that was already on screen, and in this case, they are not from the web, so there is no loading. And since you said you pressed the done button while the image was loading, the only dismiss method called is dismissPhotoBrowserAnimated:.
from idmphotobrowser.
Hello
if you see inside the doneButtonPressed line 1247 there is a call for the performCloseAnimationWithScrollView.
i have uploaded a modified smaller sized sample to my dropbox. check it here:
https://dl.dropboxusercontent.com/u/34562882/IDMPhotoBrowser.zip
all you have to do is tap the cell to open the modal and immediately
either tap the done button before the image downloads
or drag the image down to dismiss it before the image downloads.
what i forgot to mention before is that it happens when calling this ...animatedFromView initializer of the IDMPhotoBrowser.
in my scenario i have a cell image that i want the animation to begin with thats why i use the animatedFromView:...
hope now you can understand where it crashes.
thanks
from idmphotobrowser.
hello @eduardocallado ,
The problem is https://github.com/ideaismobile/IDMPhotoBrowser/blob/master/Classes/IDMPhotoBrowser.m#L385
When call the performCloseAnimationWithScrollView, UIImage imageFromView = [scrollView.photo underlyingImage]; was called, but for remote loading image, underlyingImage is nil before loadUnderlyingImageAndNotify. So float scaleFactor = imageFromView.size.width / screenWidth; got 0, and when some number divide scaleFactor, it gets NaN, which cause the problem of
** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [160 nan]'
from idmphotobrowser.
This could be fixed with a check for nil like in my first post.
if someone has a more solid solution please share
thanks
from idmphotobrowser.
Now I get it. And I just fixed it.
Thank you guys for the help.
from idmphotobrowser.
No problem.
Glad I could be of assistance.
Thanks
Sent from my iPhone
On 8 Οκτ 2013, at 17:09, "Eduardo Callado" [email protected] wrote:
Now I get it. And I just fixed it.
Thank you guys for the help.—
Reply to this email directly or view it on GitHub.
from idmphotobrowser.
I have the same problem and I checked the code, at -[IDMPhotoBrowser performCloseAnimationWithScrollView:]
method, there are two lines:
float scaleX = senderViewOriginalFrame.size.width/scrollView.photoImageView.width;
float scaleY = senderViewOriginalFrame.size.height/scrollView.photoImageView.height;
scrollView.photoImageView.width
and scrollView.photoImageView.height
are both 0
when user taps the done button without waiting for the whole image to download, so it crashed.
My solution is that:
float scaleX = 0;
if (scrollView.photoImageView.width > 0) {
scaleX = senderViewOriginalFrame.size.width/scrollView.photoImageView.width;
}
float scaleY = 0;
if (scrollView.photoImageView.height > 0) {
scaleY = senderViewOriginalFrame.size.height/scrollView.photoImageView.height;
}
from idmphotobrowser.
Related Issues (20)
- Delegate
- crash HOT 3
- No 'long press detecting' any more?
- ForceHideStatusBar property doesn't work HOT 2
- Crash while custom IPhoto Protocol Implement
- Annoying flickering when dismissing the view
- actionButtonImage not shown. HOT 1
- Images are displayed from topleft side of the screen in inconsistent times HOT 1
- Double tap to zoom out on image does not work often. HOT 2
- @selector(doneButtonPressed:) memery leak HOT 1
- 在borwser显示后,卡住约莫有0.5秒,不能响应事件 HOT 2
- Crash in iOS 11 in method - (UIButton*)customToolbarButtonImage:(UIImage*)image imageSelected:(UIImage*)selectedImage action:(SEL)action
- pod 'IDMPhotoBrowser', '~> 1.11.3' 版本找不到"IDMUtils类
- 无非就是复制MWPhotoBrowser,依赖了4个其余框架,垃圾
- self.zoomScale == self.maximumDoubleTapZoomScale, this case never happens
- The way to solve image twinkling on iOS13
- MobileCoreServices has been renamed to CoreServices in Xcode 11.4
- 此框架已经没有人更新了,有更好的大家在这里记录一下
- Please add SPM Suport
- fatal error: 'SDWebImage/SDWebImageManager.h' file not found #import <SDWebImage/SDWebImageManager.h>
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from idmphotobrowser.