Prevent invalid path from crashing the entire app and get correct mediarect #9

Merged
merged 2 commits into from Sep 26, 2012

Conversation

Projects
None yet
2 participants
@mac-cain13
Contributor

mac-cain13 commented Sep 25, 2012

Hi!

This pull req contains 2 commits. One contains a fix for invalid paths, the library will now just return nil objects instead of crashing. This is more like UIImage is behaving in general and somewhat easier to work with if you generate filenames dynamically and it's possible that the image doesn't exists.

The second makes sure the correct mediarect is returned, if you rendered a image on page 3 (or any page other then 1) the mediarect from page 1 was used. That is not necesseraly the correct rect, this commit fixes that.

Hope you will take this changes in! Let me know if we need to change or tweak anything to make it in to your repos!

Cheers,
Mathijs Kadijk

mac-cain13 added some commits Sep 25, 2012

Fixed PDFView mediaRectForURL: calls
All calls now request the rect for the correct page.
Invalid resource path/url will return nil UIImages
before this commit the App just crashed on invalid paths.

mindbrix added a commit that referenced this pull request Sep 26, 2012

Merge pull request #9 from wrep/master
Prevent invalid path from crashing the entire app and get correct mediarect

@mindbrix mindbrix merged commit e6ea355 into mindbrix:master Sep 26, 2012

@mindbrix

This comment has been minimized.

Show comment
Hide comment
@mindbrix

mindbrix Sep 26, 2012

Owner

Hi Mathijs. Many thanks for these updates. It's good to have some help.

Best,
Nigel.

Owner

mindbrix commented Sep 26, 2012

Hi Mathijs. Many thanks for these updates. It's good to have some help.

Best,
Nigel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment